question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Library not working on Android Emulator

See original GitHub issue

Hi everyone,

first of all I need to tell u that I am beginner with ReactNative, so if at the end this resolves as something stupid, forgive me.

I have created new app using the command: npx react-native init puzzleNative for the application I want to build.

My Gradle version is:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

My package.json looks like this:

  "name": "puzzleNative",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-native-fontawesome": "^0.2.7",
    "@reduxjs/toolkit": "^1.7.1",
    "animate.css": "^4.1.1",
    "react": "17.0.2",
    "react-native": "0.67.2",
    "react-native-drax": "^0.9.3",
    "react-native-gesture-handler": "^2.2.0",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2"
  },
  "devDependencies": {
    "@babel/core": "^7.17.2",
    "@babel/runtime": "^7.17.2",
    "@react-native-community/eslint-config": "^3.0.1",
    "babel-jest": "^27.5.1",
    "eslint": "^8.9.0",
    "jest": "^27.5.1",
    "metro-react-native-babel-preset": "^0.68.0",
    "react-test-renderer": "17.0.2"
  },
  "jest": {
    "preset": "react-native"
  }
}

And in the App.js file I am just trying to run the example from the github page like so:

import React from 'react';
import { StyleSheet, View } from 'react-native';
import { DraxProvider, DraxView } from 'react-native-drax';

export default function App() {
  return (
    <DraxProvider>
      <View style={styles.container}>
        <DraxView
          style={styles.draggable}
          onDragStart={() => {
            console.log('start drag');
          }}
          payload="world"
        />
        <DraxView
          style={styles.receiver}
          onReceiveDragEnter={({ dragged: { payload } }) => {
            console.log(`hello ${payload}`);
          }}
          onReceiveDragExit={({ dragged: { payload } }) => {
            console.log(`goodbye ${payload}`);
          }}
          onReceiveDragDrop={({ dragged: { payload } }) => {
            console.log(`received ${payload}`);
          }}
        />
      </View>
    </DraxProvider>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  draggable: {
    width: 100,
    height: 100,
    backgroundColor: 'blue',
  },
  receiver: {
    width: 100,
    height: 100,
    backgroundColor: 'green',
  },
});

I am using Android 10 Q for my emulator. image

Please if someone can help me I would really appreciate it.

Thanks in advance! 😃

And I can’t drag the bluebox. I dont have any errors in the console.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shabaz-ejazcommented, Jun 26, 2022

Having same issue with Android emulator and ``react-native-gesture-handler": “^2.4.2”. Think this needs to be addressed as it doesn’t seem to like the new versions of react-native-gesture-handler. It will only be a problem going forward for Android.

1reaction
lafioscacommented, Feb 14, 2022

Hello @djordje47! I apologize that I will likely not have time to try to look into this and reproduce it myself, but I am curious about your screenshot. At the bottom it shows a yellow box dev warning from react-native-gesture-handler. Drax is built on top of react-native-gesture-handler, so if something is misconfigured about that, it will not work. Can you look into what that warning is and see if it helps you out?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >
Cannot start Android Emulator - Library not loaded
My Mac is running Mojave and I ran into this problem after upgrading my Android Emulator version to v30.5.3 today. I downgraded my...
Read more >
AVD Emulator not working anymore on Bumblebee #76 - GitHub
Uninstall emulator in android studio by going to sdk tools and uncheck emulator option and then click apply. Download canary Dolphin version ...
Read more >
Troubleshooting Common Issues | CodePath Android Cliffnotes
If you are having issues trying to connect to the emulator or see any type of "Connection refused" errors, you may need to...
Read more >
Android Studio Emulator - Expo Documentation
If you don't have an Android device available to test with, we recommend using the default emulator that comes with Android Studio. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found