Could not install the app on the device, read the error above for details.
jax$ 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
jax$ adb devices
List of devices attached
192.168.56.101:5555 device
how can I fix it , On my computer . It's ok for react-native run-ios and it's ok for react-native run-android on my company computer
@RainliFu
you might check the permissions on android/gradlew
they should be 755 not 644
run chmod 755 android/gradlew inside your app root folder
then run react-native run-android
and it should work again.
@cyprusglobe Thanks for your help,I will try later! My company computer is ok .
@cyprusglobe Your suggestion worked. Thanks a lot.
It works for me too !! Thx!!! @cyprusglobe
@cyprusglobe should this be put in documentation?
I have simillary issues but error message looks -```
Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define La
ndroid/support/v7/appcompat/R$anim;
Unknown source file : at com.android.dx.merge.DexMerger.readSortableTypes(DexM
erger.java:596)
Unknown source file : at com.android.dx.merge.DexMerger.getSortedTypes(DexMerg
er.java:554)
Unknown source file : at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerg
er.java:535)
Unknown source file : at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.j
ava:171)
Unknown source file : at com.android.dx.merge.DexMerger.merge(DexMerger.java:1
89)
Unknown source file : at com.android.dx.command.dexer.Main.mergeLibraryDexBuff
ers(Main.java:502)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.jav
a:334)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)
:app:dexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.E
xecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe'
' finished with non-zero exit value 2
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 22.166 secs
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
(node:6876) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 2): TypeError: Cannot read property 'message' of undefined
@cyprusglobe thanks your advice.it's useful
@cyprusglobe Thanks for your help. This pit is good!
how about windows i am getting the same error?
Had similar problem, but with
NoClassDefFoundError. Uninstalling java and jdk, rebooting and installing java and jdk (x86 and x64) helped me.
Thanks, it worked!
@cyprusglobe it works for me too, thanks
if your android rom is MIUI ROM,find the solution: go settings -> developer option -> close MIUI optimization
Thanks, it worked! good !
I got the same error on windows. Could you give me some solutions?
Just starting out by downloading the latest react-native-cli. I do have the Android Emulator running in the background. Am running into similar issue and am not sure how to @cyprusglobe's solution....
I also try like this as you commented, but the error has not gone. I want to run with external device. Thanks @coderabsolute
I finally figured out the problem and solved it.
@eaintphyo ,我想知道你是怎么解决的呀!?
@eaintphyo ,can you share the experience! thanks!