You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adb: failed to stat app/build/outputs/apk/app-debug.apk: No such file or directory #18243
--Should have installed the apk without any issue
--Having Problem with all android devices
Actual Behaviour
**BUILD SUCCESSFUL in 2m 18s**
164 actionable tasks: 3 executed, 161 up-to-date
Running /home/rivertech/Android/Sdk/platform-tools/adb -s ZY2243ZMVC reverse tcp:8081 tcp:8081
adb server version (36) doesn't match this client (39); killing...
* daemon started successfully
Installing the app on the device (cd android && adb -s ZY2243ZMVC install app/build/outputs/apk/app-debug.apk
**adb: failed to stat app/build/outputs/apk/app-debug.apk: No such file or directory**
Command failed: /home/rivertech/Android/Sdk/platform-tools/adb -s ZY2243ZMVC install app/build/outputs/apk/app-debug.apk
**Could not install the app on the device, read the error above for details.**
Starting the app on ZY2243ZMVC (/home/rivertech/Android/Sdk/platform-tools/adb -s ZY2243ZMVC shell am start -n com.demo/com.demo.MainActivity)...
Starting: Intent { cmp=com.demo/.MainActivity }
Error type 3
Error: Activity class {com.demo/com.demo.MainActivity} does not exist.
Reacted by Fuad Balashov, Shingo Inoue, Kriss M., YY and Seph Soliman
I had the same issue. I think the problem is when android studio starts building this app-debug.apk. For some reason, this directory android/app/build/output/apk has child directories debug and release. This is why react-native-cli throws No such file or directory because it cant find it. The app-debug.apk is in debug directory.
put this in your android/app/build.gradle def enableSeparateBuildPerCPUArchitecture = false
you are creating this for multipe cpu architecture that's why it is failing
I found that running with --deviceId parameter cause this problem, when I run only react-native run-android there's no problem.
Try this: adb -s [deviceId] install android/app/build/outputs/apk/app-debug.apk
Reacted by Daniel Dixon, ali, Abednego Mwanza, Christoph, Mike Cranston, datvp, Christian Torres, Thibault PIRONT, Brett Adams, Andrew and 11 more
Reacted by Daniel Dixon, QuyenQuyen, chansuke, Thibault PIRONT, José Geraldo de Lima Júnior and João Marcos Mainka
I reopen this thick as I guess this is a bug: currently, when building release variant and specifying the deviceId, the debug-apk filename is tried to be installed on the device. This is wrong. In stead, the filename for the release apk should be used.
cd android && adb -s {{THE_GIVEN_DEVICE_ID}} install app/build/outputs/apk/app-debug.apk
Should be:
cd android && adb -s {{THE_GIVEN_DEVICE_ID}} install app/build/outputs/apk/release/app-release.apk
Reacted by Top Master, Christian Torres, Michael Neumair and YY
Why this is closed? So the recommended way is compile apk first and than manually use adb install to install on a specific device? No plan to fix the --deviceId option? I think it's better to fix the deviceId option right? Otherwise if it's not working then what's the point of having that option.
@ysyyork I closed it as a workaround had been posted, and no one left a comment for a few months after that. If you think this should be fixed in the react-native CLI, a group of contributors have forked the CLI into a new repo at https://github.com/react-native-community/react-native-cli. Please consider opening an issue there, as the CLI has been removed from this repository.
For the lost souls of the future: The reason this breaks can also be that you've changed outputFileName somewhere in a build.gradle file. The apk seems hard-coded to app-debug.apk which means React Native will try to install the wrong file. In case you just changed the name, you may see see symptoms of the app not updating.
Activity
chipcerio commentedon Mar 16, 2018
I had the same issue. I think the problem is when android studio starts building this app-debug.apk. For some reason, this directory
android/app/build/output/apkhas child directoriesdebugandrelease. This is why react-native-cli throwsNo such file or directorybecause it cant find it. The app-debug.apk is indebugdirectory.I moved the apk to
android/app/build/output/apkdatvp09 commentedon May 2, 2018
@chipcerio you're right
just use the command
adb -s [deviceId] install android/app/build/outputs/apk/app-debug.apknerjok commentedon May 6, 2018
has anyone solved without c&p that fdebug.apk manualy? and adb install?
Abby3017 commentedon May 26, 2018
put this in your android/app/build.gradle
def enableSeparateBuildPerCPUArchitecture = falseyou are creating this for multipe cpu architecture that's why it is failing
datvp09 commentedon May 26, 2018
I found that running with
--deviceIdparameter cause this problem, when I run onlyreact-native run-androidthere's no problem.Try this:
adb -s [deviceId] install android/app/build/outputs/apk/app-debug.apkdirkpostma commentedon Aug 23, 2018
I reopen this thick as I guess this is a bug: currently, when building release variant and specifying the deviceId, the debug-apk filename is tried to be installed on the device. This is wrong. In stead, the filename for the release apk should be used.
Should be:
rafaelmaeuer commentedon Oct 5, 2018
Hey this is still an issue, is there a solution for not moving the apk by hand?
devsimatech commentedon Oct 19, 2018
You could use a hook to copy over the apk
rafaelmaeuer commentedon Oct 19, 2018
I used this workaround: https://stackoverflow.com/questions/46985530/change-apk-output-folder-in-gradle-4-1/48121314#48121314
gildardoperez commentedon Oct 19, 2018
Updated the correct path on @datvp09, was missing /debug/
react-native-cli: 2.0.1
react-native: 0.57.3
Connect your Android device via USB:
> adb devicesList of devices attached
988se6666555453 device
> adb -s 988se6666555453 install android/app/build/outputs/apk/debug/app-debug.apk> react-native run-android --deviceId 988se6666555453ysyyork commentedon Jan 20, 2019
Why this is closed? So the recommended way is compile apk first and than manually use adb install to install on a specific device? No plan to fix the --deviceId option? I think it's better to fix the deviceId option right? Otherwise if it's not working then what's the point of having that option.
hramos commentedon Jan 22, 2019
@ysyyork I closed it as a workaround had been posted, and no one left a comment for a few months after that. If you think this should be fixed in the
react-nativeCLI, a group of contributors have forked the CLI into a new repo at https://github.com/react-native-community/react-native-cli. Please consider opening an issue there, as the CLI has been removed from this repository.ysyyork commentedon Jan 28, 2019
@hramos I see. Sounds good. Thanks
scarlac commentedon Mar 13, 2019
For the lost souls of the future: The reason this breaks can also be that you've changed
outputFileNamesomewhere in a build.gradle file. The apk seems hard-coded toapp-debug.apkwhich means React Native will try to install the wrong file. In case you just changed the name, you may see see symptoms of the app not updating.joaom182 commentedon Jun 28, 2019
@scarlac i've not changed de outputFileName and the error occurs only when i use --deviceId option as reported by @datvp09.