Josh.F
Josh.F

Reputation: 3806

How do I solve this error with gradle in ReactNative on Linux?

Note: I actually just solved this and I am posting my solution here since it was a vague error message that took some time to solve. Hopefully, I can help out one other person!

> react-native run-android Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/android-setup.html

Looking around online, I saw similar error messages, but which were more verbose and solved in other ways. My solution is luckily simple, and it's in the answer below!

Upvotes: 0

Views: 889

Answers (2)

Aditya Singh
Aditya Singh

Reputation: 16660

Do you have an actual device or a emulator connected? In case you don't refer the setup of GenyMotion (https://www.genymotion.com/download/) and once done create an emulator. This should solve your issue. Let me know if you still face the problem

Upvotes: 0

Josh.F
Josh.F

Reputation: 3806

Just make ./android/gradlew an executable. (chmod +x android/gradlew)

You can test that it's working with cd android && ./gradlew

This was eventualy solved by just trying ./gradlew and getting the more telling error message that it needs to be executable.

Good luck with the rest of your project, if you stumbled into this error!

Upvotes: 2

Related Questions