react-native run-android, Could not install the app on the device, read the error above for details.

Created on 14 Dec 2017  Â·  9Comments  Â·  Source: facebook/react-native

D:Reactbaru>react-native run-android
Scanning folders for symlinks in D:Reactbarunode_modules (56ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

    SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

  • 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: 8.765 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

=================
please help, i was new project
i was configure path sdk, tools, etc
npm version is lates

spesifikasi latop
windows 10

Ran Commands Locked

Most helpful comment

@gwanjar @syi51 @francisrod01 @facebook-github-bot @react-native-bot
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.

All 9 comments

@facebook-github-bot no-template

Hey @gwanjar, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!

How to Contribute • What to Expect from Maintainers

The same problem:

In my case, I have my device connected but it was impossible install the app in it.

In my emulator is running perfectly.

My environments:

Environment:
  OS: Linux 3.16
  Node: 8.8.1
  Yarn: 1.3.2
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: N/A
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: 0.51.0 => 0.51.0

Linux Version 3.16.0-4-amd64, Compiled #1 SMP Debian 3.16.51-3 (2017-12-13)
Four 1.87GHz Intel i5 Processors, 7.9GB RAM, 13569 Bogomips Total
debian

: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: No connected 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: 36.151 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
paneladm@debian:~/projects/react-native-apps/AwesomeProject$ 
paneladm@debian:~/projects/react-native-apps/AwesomeProject$ 
paneladm@debian:~/projects/react-native-apps/AwesomeProject$ 

paneladm@debian:~/projects/react-native-apps/AwesomeProject$ adb devices
List of devices attached 
T099703ZXQ  device

paneladm@debian:~/projects/react-native-apps/AwesomeProject$ 

PATH environmens:

$ echo $PATH 
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:~/.local/bin:/home/paneladm/.yarn/bin:~/Documents/Tools/PhpStorm/bin:/usr/lib/jvm/jdk1.8.0_144/bin:/home/paneladm/Android/Sdk:/home/paneladm/Android/Sdk/tools:/home/paneladm/Android/Sdk/platform-tools:/opt/android-studio/bin:~/mongodb/bin:/usr/lib/x86_64-linux-gnu/qt4/bin:/home/paneladm/projects/IT-Tools/Workbench-Build122

user@Silver-PC MINGW32 /e/jongstar/pcb/Task Project/city/AiXyGov-0418
$ react-native run-android
Scanning folders for symlinks in E:jongstarpcbTask ProjectcityAiXyGov-0418 node_modules (541ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat install Debug)...
Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:59)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 21 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
... 27 more
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

I have familliar problem above please help me

@gwanjar @syi51 @francisrod01 @facebook-github-bot @react-native-bot
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.

I solved it by uninstalling the adb from the system and using only the Sdk.

@Usamaliaquat123 thanks u

@Usamaliaquat123 Can you please provide solution for Windows?

react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

BUILD FAILED in 1s
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/getting-started.html

Was this page helpful?
0 / 5 - 0 ratings