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
I am getting this type of error
error: could not install smartsocket listener: cannot bind to
127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) 1:34:26
PM could not read ok from ADB Server 1:34:26 PM * failed to start
daemon * 1:34:26 PM error: cannot connect to daemon 1:34:26 PM
'C:\Users\MITESH
SUTHAR\AppData\Local\Android\Sdk\platform-tools\adb.exe,start-server'
failed -- run manually if necessary 1:38:14 PM Unable to obtain result
of 'adb version'
my genymotion device is running but it shows me that no device
I came across the same error. I provided the below command and the issue got solved.
COMMAND :- taskkill /f /im adb.exe
Close Eclipse or Android Studio if either is running (Optional).
Open Command Prompt.
Go to the Android SDK platform-tools directory.
Type adb kill-server.
Type adb start-server.
If no error message is thrown while starting ADB server, then adb is started successfully.
OR
Go to Task Manager, open the Processes tab, and end the adb.exe process.
Then restart Android Studio.
This may work if there is any problem with adb.
In my case, none of the above solution worked. I solved it strangely maybe it can be a bug.
Do not run Genymotion emulator before Android Studio. Firstly, I opened android studio then I clicked run project and select deployment target windows appeared. Then I run genymotion emulator and now the emulator is shown in the select deployment target windows in Android Studio. Then deployed to the emulator without errors. Done!
As another way, you can try to set Genymotion sdk to the same as Android studio sdk. To do this, first find your sdk location. You can find it by right clicking the Android Studio project -> Open Module Settings-> Select SDK location -> under Android SDK location, it is shown. Then open Genymotion -> Settings -> ADB tab -> Click Use custom Android SDK tools radio button -> navigate to SDK folder used by Android studio -> Restart Genymotion virtual device
If none of the above worked for you, just make sure that you have closed Genymotion emulator as it caused this issue with me.
Easiest Way! I just ran into this issue trying to connect a React-Native App to an Android Studio emulator. If you read the error message it tells you that "Only one usage of each socket address (protocol/network address/port) is normally permitted." So you can assume that something other than React-Native is also attempting to connect to the emulator.
Terminate The Connections:
Leave the emulator running.
Close out of and uninstall any Android Studio/Eclipse Apps you have on the emulator. This terminates apps trying to connect.
Close Eclipse or Android Studio if either are running. Android Studio doesn't have to be open in order for the emulator to work (This is important). This terminates software trying to connect.
After doing so I went back into my React-Native App and connected to Expo no problem.
All you have to do is terminate all connections. However you so choose.
I came across the same error, it worked simply after restarting the AS on windows, of course, it asked for SDK update.
Android Studio 4.1.3 with API 30 installation has this error
01-04-2021
09:56 'C:\Users\ranja\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
Tried C:\Users\ranja>adb start-server
daemon not running; starting now at tcp:5037
**could not read ok from ADB Server
failed to start daemon
error: cannot connect to daemon**
Note: I have added 'C:\Users\ranja\Android\Sdk\platform-tools' in %PATH% environment variable on Windows 10
i've encountered same error in my ionic 2. i just uninstall and reinstall ionic. and it works fine again..
npm uninstall -g ionic
npm install -g ionic
I am unable to run my Ionic app in --livereload mode. It gives me an error as:
Error: C:\softwares\android-sdks\platform-tools\adb.exe: Command failed with exit code 1 Error output:
error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
I started task manager and found 3 adb server are running.I tried to kill them but unable to do that. Please help.
I had same problem while running application with genymotion. I gave the custom path of my sdk in adb settings in configuration of genymotion. And it worked for me.
Also same problem occurs if there is duplication of sdk paths.So you should also check your environment variables for that.
I have upgraded from Android Studio 1.5 to 2.0 yesterday (Using Linux Mint 17.3) . It worked well. But from today morning whenever I start my Android Studio it shows a dialogue box with error:
Unable to create Debug Bridge: Unable to start adb server: error: cannot open '/tmp/adb.log': Permission denied
ADB server didn't ACK
* failed to start daemon *
'/home/shahid/Android/sdk/platform-tools/adb,start-server' failed -- run manually if necessary
I have tried adb kill-server, adb start-server. Almost same error in the terminal.
Almost a month ago I directly debugged application on my device with Processing (PDE) but today when I'm trying to deploy the application it doesn't work (keep in mind that I have updated SDK) it keeps getting an error as follows:
error: cannot connect to daemon
nope: adb devices
status: 1
1065ms
stdout:
* daemon not running. starting it now *
stderr:
CreateProcess failure, error 2
* failed to start daemon *
Even if I run any of the command like adb devices or adb shell I get an error
C:\Users\Hassan>adb devices
* daemon not running. starting it now *
CreateProcess failure, error 2
* failed to start daemon *
error: cannot connect to daemon
I looked on several places and almost everyone said that kill the adb.exe process from task manager but any of that didn't work, I have also disabled the antivirus in case if that was messing, and also allowed the port 5037 in my firewall. what else can i try ?
Open the terminal and run following command
adb kill-server and - adb start-server
Now run adb devices to see the list of devices
I faced this problem while accessing the device in Appium Studio
I had a similar problem - where the error that I was getting was:
\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error executing "adb devices": ** daemon still not running
error: cannot connect to daemon
ERROR running one or more of the platforms: Error: \platforms\android\
cordova\run.bat: Command failed with exit code 8
It seems adb runs on port 5037 and when I checked somhow mozilla firefox was holding on to these ports
netstat -ao 5039
so killing mozilla firefox and running the command:
cordova run android
atleast I dont get this exception anymore
running skipsoft's unified android toolkit fixed this for me
all i did was launch it, select model, select build and finally the device asked usb debugging permission. from there on adb worked