react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Android][react-native run-android] app:installDebug error

Open muraliv opened this issue 11 years ago • 51 comments

[muralive@AwesomeProject ]$ react-native run-android Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug)... :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42300Library UP-TO-DATE :app:prepareComFacebookFrescoDrawee061Library UP-TO-DATE :app:prepareComFacebookFrescoFbcore061Library UP-TO-DATE :app:prepareComFacebookFrescoFresco061Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipeline061Library UP-TO-DATE :app:prepareComFacebookFrescoImagepipelineOkhttp061Library UP-TO-DATE :app:prepareComFacebookReactReactNative0110Library UP-TO-DATE :app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE :app:processDebugJavaRes UP-TO-DATE :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources UP-TO-DATE :app:preDexDebug UP-TO-DATE :app:dexDebug UP-TO-DATE :app:validateDebugSigning :app:packageDebug UP-TO-DATE :app:zipalignDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE :app:installDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:installDebug'.

    com.android.builder.testing.api.DeviceException: com.android.ddmlib.ShellCommandUnresponsiveException

  • 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: 29.7 secs Could not install the app on the device, see the error above.

muraliv avatar Sep 15 '15 08:09 muraliv

##I'm now getting this error:

:app:installDebug Skipping device 'emulator-5554' (emulator-5554): Device is OFFLINE. :app:installDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:installDebug'.

    com.android.builder.testing.api.DeviceException: No online devices found.

  • 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: 20.503 secs Could not install the app on the device, see the error above.

muraliv avatar Sep 15 '15 08:09 muraliv

The issue was with the Android Emulator. Changed the AVD settings to enable "Use Host GPU" and the issue was resolved.

muraliv avatar Sep 15 '15 09:09 muraliv

Yes, this is a problem with the Android SDK being super slow sometimes:

  • ShellCommandUnresponsiveException means installing the APK (simply running adb install) timed out
  • No online devices found means the emulator went into a bad state and is not responding to any adb commands

Using the host GPU and hardware acceleration (HAXM on OSX / Windows, KVM on Linux) usually helps with this. Or switching to Genymotion.

However, there is nothing we can do about this, since the problem is with the Android tooling. Thus, I'm closing this issue.

foghina avatar Sep 15 '15 10:09 foghina

@muraliv. you are right, thank you (github needs up-vote function)

leoabacade avatar Sep 18 '15 18:09 leoabacade

@muraliv thanks for the solution!

mzabriskie avatar Oct 09 '15 15:10 mzabriskie

@muraliv Using the host GPU not work for me. still get

......

:app:validateDebugSigning :app:packageDebug UP-TO-DATE :app:zipalignDebug UP-TO-DATE :app:assembleDebug UP-TO-DATE :app:installDebug Skipping device 'emulator-5554' for 'app:debug': Unknown API Level :app:installDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:installDebug'.

    Failed to install on any devices.

  • 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: 27.609 secs Could not install the app on the device, see the error above.

any solutions ?

jixiaod avatar Oct 20 '15 06:10 jixiaod

@jixiaod In case you missed it, you need to start your emulator before running "react-native run-android"

ericcch avatar Oct 25 '15 17:10 ericcch

You can also try Genymotion, it's much faster than the Android Emulator.

satya164 avatar Oct 25 '15 17:10 satya164

hm, my emulator from genymotion is running, but I also got this error. any suggestion?

swdevbali avatar Dec 14 '15 14:12 swdevbali

Try: 1、open android Emulator; 2、react-native run-android; error??!! goto 3; 3、adb install app/build/outputs/apk/app-debug.apk;

puresteelzhang avatar Dec 17 '15 06:12 puresteelzhang

@jixiaod any update? I got the error you got.

verystrongjoe avatar Feb 19 '16 06:02 verystrongjoe

@swdevbali Same here. Is Genymotion somehow not targeted?

csholmq avatar Feb 28 '16 14:02 csholmq

For other coming here, try and downgrade Gradle to version 1.2.3 in your <project-name>/android/build.gradle

https://github.com/facebook/react-native/issues/2720

csholmq avatar Feb 29 '16 11:02 csholmq

Execution failed for task ':app:installDebug'. com.android.ddmlib.ShellCommandUnresponsiveException Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

what should i do

DYQDYQ avatar Apr 12 '16 09:04 DYQDYQ

@DYQDYQ I faced the same issure, which was sovled by @csholmq's solution.

dunhuang avatar Apr 25 '16 06:04 dunhuang

:+1:

syzer avatar Jun 03 '16 15:06 syzer

I had this issue and it was the wrong "Android SDK Build-tools installed".
screen shot 2016-06-06 at 12 48 19 pm

wlund-pivotal avatar Jun 06 '16 19:06 wlund-pivotal

I can't even start the emulator with avd, did anyone knows why?

igongora avatar Jun 28 '16 20:06 igongora

@wlund-pivotal so simple, but it was exactly my issue, thx! My react-native installation needed 23.0.1, yet I had 24.0.0 installed.

hurrtz avatar Jul 10 '16 19:07 hurrtz

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

jaxlifu avatar Jul 18 '16 16:07 jaxlifu