I am facing this issue when trying to run any flutter app on android emulator or physical device. It fails while executing adb command for installing the application.
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to open /Users/mohitsingh/Desktop/testapp/testapp/build/app/outputs/flutter-apk/app.apk: Operation not permitted
Warning: Failed to install APK.
However if I run the same command manually, It fails with the same error for the first time after app is built with flutter build apk command but it is successfully installed on subsequent trials with
adb -s emulator-5554 install build/app/outputs/flutter-apk/app.apk
All other commands of adb seem to work fine. It was working fine till last week but this error started coming up suddenly with adb.
Error: ADB exited with exit code 1 is a common error
Here are the following solutions for that
Solution 1
add android:exported="true in your AndroidManifest.xml file
<activity android:name=".MainActivity"
android:exported="true"
Solution 2
Turn on Install via USB in developer mode.
run the following Command
flutter clean
flutter pub
flutter run
Related
Sometimes when I go to build and test my apps I get this error and it drives me off the wall. I never had to deal with this before.
Installation Failure
com.android.ddmlib.InstallException: 'cmd package install-create -r -t --full -S 2816556' returns error 'Unknown failure: cmd: Can't find service: package'
I tried following this guide here
Application Installation Failed in Android Studio
I did all the suggestions disable instant run, build apk then rebuild app, restart computer, restart android studio, use different virtual device.
Idk anymore any ideas? I am using Android Studio 3.4.1
Update: Fixed it my issue sorta. If i first launch my virtual device and get it loaded. Then run my app the error doesn't pop up. This leads me to believe that Android Studio will throw the installation error because it can't run the app on the virtual device since it takes forever to load on my laptop
I'm getting the next error, I have tried: deleting the app, cleaning the project, also allowing the 'Unknown sources' in the phone settings but i get the same error with all the apps, even the new apps that i try to install just to test.
Also in the Console i get this error:
11/27 17:19:48: Launching app
$ adb push C:\Users\ozkr2805\AndroidStudioProjects\Test\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/ink.test
$ adb shell pm install -t -r "/data/local/tmp/ink.test"
Error while accessing provider:com.rscja.secapp.provider.authcode
java.lang.IllegalStateException: Could not find provider: com.rscja.secapp.provider.authcode
at com.android.commands.pm.Pm$Command.execute(Pm.java:173)
at com.android.commands.pm.Pm.main(Pm.java:252)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:276)
pkg: /data/local/tmp/ink.test
Success
Error while Installing APK
The device i have is: Chainway C71 Handheld Computer, don't know if this helps.
Thank you for any advice!
I'm having the same problem. I have re-installed android studio and done a factory reset on the device, but it still fails. After flashing my smartphone the problem is fixed.
My ADB install does not work, it does not start or show any info. I keep getting the same error message over and over again:
18:14 Unable to run 'adb': null
18:14 '/Users/jorandob/Library/Android/sdk/platform-tools/adb start-server' failed -- run manually if necessary
If I try to start ADB manually it just doesn't show anything.
I tried so far:
Restart server
Reinstall ADB
Reinstall Android Studio
I'm on mac os X 10.11.6 and not using any special emulator.
If its helpful information, I'm using ionic.
Terminal ADB:
Jorans-iMac:~ jorandob$ adb version
Android Debug Bridge version 1.0.36
Revision 0e9850346394-android
I finally resolved my issue, it occurs if you run java and ADB at the same time.
to fix it stop all java processes in the activity monitor.
My ionic 2 application can't be run in Genymotion Android emulator. The error message is:
ERROR running one or more of the platforms: Error: adb: Command failed
with exit code 1 Error output: error: could not install smartsocket
listener: Address already in use ADB server didn't ACK
* failed to start daemon * error: cannot connect to daemon You may not have the required environment or OS to run this project
It seems the port number is taken already. But it works fine for normal AVD emulator when I stop the Genymotion emulator.
Any idea? Thanks.
Fixed the problem by changing the settings in Genymotion.
Running cordova emulate android gives the following error-
Error: Failed to install apk to emulator: Error executing "adb -s emulator-5554 install -r "C:/work/projects/cordova/projectName/platforms/android/build/outputs/apk/android-debug.apk"":
The error message is not actually correct because the new apk is deployed to the emulator (i have performed minor changes and the apk is updated on emulator), but the app is not started.
When I manually run the adb command that is shown in the error message i get a windows dialog saying that adb.exe has stopped responding. No error msg on the command line. Although the app on the emulator has again updated (so installation is working) and can be manually run from the emulator.
When I copy adb version 1.0.31 (exe and two dlls) over the top of version 1.0.32 in \platform-tools it all runs as expected- loads apk and starts app, no errors, regardless of whether i use cordova commands or adb command directly.
Has anyone had this issue with adb1.0.32 and or have a work solution? I have a workaround which is to use 1.0.31, but I would like to know what the issue is.