React-Native, Android, Genymotion: ADB server didn't ACK - android

I am working with React-Native, Android, and Genymotion on Mac. When I run react-native run-android I get this lines at the end of the launch operation:
...
04:54:40 E/adb: error: could not install *smartsocket* listener: Address already in use
04:54:40 E/adb: ADB server didn't ACK
04:54:40 E/ddms: '/Users/paulbrie/Library/Android/sdk/platform-tools/adb,start-server' failed -- run manually if necessary
04:54:40 E/adb: * failed to start daemon *
04:54:40 E/adb: error: cannot connect to daemon
:app:installDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: Timeout getting device list.
...
However, adb devices returns this:
List of devices attached
192.168.59.101:5555 device
So far I've found no solution to run my app on the emulator. Has anyone encountered the same issue?
Thanks,
Paul

After more research I've realized that Genymotion uses by default its own adb.
I switched to my main adb (the same used by react-native) and it solved the issue. I guess that because Genymotion's adb was launched first I got the Address already in use error message.

I am using genymotion, but Paul's solution alone did not fix the error (for Mac).
I had to:
Update Android SDK to the latest version (24.4.1) via the SDK manager
Type android in the command line
In the SDK manager find the latest SDK tools and install.
Once installed the SDK path should update the new SDK location like below.
Then update the $ANDROID_HOME to use the new SDK
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Confirm it has been added by viewing your path with echo $PATH
Then in genymotion do what #Paul says above and point genymotion ADB to use the same sdk

System: Windows 10
My issue: Setting Genymotion to point to the custom SDK didn't have any affect. I still received the:
Couldn't start project on Android: 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
What I discovered was there was a difference in ADB versions being used throughout the system. Here is the command I used to find them:
where /r C:\ adb.exe
This produced the results:
C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
C:\Program Files\Genymobile\Genymotion\tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb backup\adb.exe
Navigating to each directory and running:
adb.exe version
Allowed me to see that Expo was running ADB version:
Android Debug Bridge version 1.0.36
Revision fd9e4d07b0f5-android
While Genymotion using the custom SDK had version (c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe):
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
As a test I took the adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) from
c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
and placed them into a backup folder. I then moved the adb files located at
c:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
into that same location. I killed adb with:
adb kill-server
which caused a restart of the adb server automatically due to having my Genymotion device already running. I hit the "Restart" button inside of the Expo XDE and it immediately began working. Here is the log where I hit the restart button at 1:13:04 AM:
12:45:53 AM
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
1:13:04 AM
Restarting project and clearing packager cache (Hold shift while clicking restart to avoid clearing cache).
1:13:11 AM
Starting React Native packager...
1:13:17 AM
Scanning 543 folders for symlinks in C:\Users\kyle\git\betalog\node_modules (49ms)
1:13:17 AM
1:13:19 AM
Couldn't adb reverse: closed
1:13:20 AM
Project opened! You can now use the "Share" or "Device" buttons to view your project.
1:13:26 AM
Couldn't adb reverse: closed
1:13:26 AM
Downloading latest version of Expo
1:13:28 AM
Installing Expo on device
1:13:33 AM
Opening on Android device
1:13:56 AM
Building JavaScript bundle: finished in 59643ms.
1:14:01 AM
Dependency graph loaded.
1:14:03 AM
Your JavaScript transform cache is empty, rebuilding (this may take a minute).
Conclusion: Genymotion and Expo may need to use the same version of adb so that Expo can properly communicate with the simulated device. Pointing Genymotion to your android SDK location as well as ensuring Expo XDE has that same version will allow correct communication between devices. I moved the Expo XDE version to the SDK location, but you might be able to go the other way (take the sdk ADB files and place them in the Expo XDE resource location).
P.S. I've been all through the stackoverflow posts related to this issue. Just so you guys know my task manager shows three instances of adb.exe running. If you kill any of them they just come back.
Hope this helps /cheers

Maybe your adb versions are mismatching
Check:
adb version
Then:
cd /Path/to/Android/Sdk/platform-tools && ./adb version
If these two are different you have an error here, just remove adb from sys and copy the one that is in platform-tools to /usr/bin/

the adb version on your system is different from the adb version on the android sdk platform-tools .
Below suggestion is work for me for Linux operating system
check sys adb version run the below command
adb version
Android Debug Bridge version 1.0.39
check sdk adb version
cd /root/Android/Sdk/platform-tools
./adb version
Android Debug Bridge version 1.0.32
copy
rm /usr/bin/adb
[Note : the above command remove the existing adb then copy the adb from sdk/platform-tools directory ]
sudo cp /root/Android/Sdk/platform-tools/adb /usr/bin/adb
Then run the project using this command
react-native run-android

If want to keep your system clean, you can also use Genymotion without Android Studio:
Find Genymotion's copy of adb. On macOS this is normally /Applications/Genymotion.app/Contents/MacOS/tools/.
Add the Genymotion tools directory to your path - execute/add the line export PATH=/Applications/Genymotion.app/Contents/MacOS/tools/:$PATH to your ~/.bash_profile or ~/.bash_rc.
Make sure that you can run adb from your terminal.
(From https://docs.expo.io/versions/latest/workflow/genymotion)

I had the same thing while I tried to run from expo UI.
Did the same things, as described in answers, but app was not running.
When once tried run exp android from command line (in the project folder), application ran successfully and next times runs from Expo UI was successfully.

I had a similar issue.
First, I uninstalled the app.
Then, I pointed GenyMotion to the android sdk provided from Android Studio
Next, I ran "adb kill-server" into the terminal.
Finally, I re-ran "react-native run-android" and got a build success.

The steps worked for me are :
$ adb kill-server
$ adb start-server
$ cd android
$ ./gradlew clean
$ cd ..
$ react-native run-android

For Ubuntu
It works for me!!
check sys adb version
adb version
Android Debug Bridge version 1.0.39
2 check sdk adb version
cd /home/user_name/Android/sdk/platform-tools
./adb version
Android Debug Bridge version 1.0.32
copy
sudo cp /home/user_name/Android/sdk/platform-tools/adb /usr/local/bin
that's all! It will work now.

1.use custom sdk path in genymotion.(Suppose this one won't work means,Try to execute the second one)
2.Manually use this command to execute(SDK PATH/adb she
ll am start -n/Package name/MainActivity).
C:\Users\AppData\Local\Android\Sdk/platform-tools/adb she
ll am start -n com.example/com.example.ManiActivity
And try to run the application by using react-native run-android.

Same issue happened when I try to run my react-native project in Genymotion
For Linux ubuntu 20.04
Go to /home/mycomputer/Android/Sdk/platorm-tools
run $./adb version
just copy the adb path in /usr/bin
$ sudo cp /home/raik/Android/Sdk/platform-tools/adb /usr/bin
Then I can run my project in genymotion.
Note: In some Linux system may be copied to this path /usr/local/bin`

If someone is facing this issue in Windows with Android Studio emulator then just run following command in powershell or cmd:
taskkill /F /IM adb.exe
It should kill all the adb process instances and then you can Reload the app or Start the App on Android again via Expo CLI.

Related

Error: ADB exited with exit code 1 Performing Streamed Install

I'm receiving the following error while running flutter run on some projects, however, on other projects it works fine:
(base) Nusraths-MacBook-Pro:flutter_uber_clone rahama$ flutter emulators --launch Pixel_2_XL_API_28
(base) Nusraths-MacBook-Pro:flutter_uber_clone rahama$ flutter run
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing Gradle... 0.8s
Resolving dependencies... 1.4s
Running Gradle task 'assembly debug'...
Running Gradle task 'assembly debug'... Done 9.3s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 1.9s
Error: ADB exited with exit code 1
Performing Streamed Install
ADB: failed to install /Users/rahama/development/flutter_uber_clone/build/app/outputs/apk/app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Error launching the application on Android SDK built for x86.
It's just the flutter demo project, I haven't made any changes to it.
Actually, the answer lies in the error message of your question:
[ADB: failed to install /Users/rahama/development/flutter_uber_clone/build/app/outputs/apk/app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]Error launching the application on Android SDK built for x86.]
Your Emulator is running out of space, clear its cache:
Click on AVD Manager
Wipe Data (Your Target Device )
You are set to go..
Flutter had a new update (I think last night), run flutter upgrade in the terminal and it should work fine (at least that did it for me).
Docs:
To update both the Flutter SDK and the packages that your app depends on, use the flutter upgrade command from the root of your app (the same directory that contains the pubspec.yaml file)
https://flutter.dev/docs/development/tools/sdk/upgrading
Run in terminal
$ flutter clean
and then
$ flutter pub get
and then
$ flutter packages get
then
$ flutter run
Although I don't have any other apps installed on my emulator, when I install the flutter app, I get the same error.
I found that the storage space of the emulator is indeed not enough. Because when I created the emulator, the default was only 1024M. When I changed the storage space of the emulator to 4096M, the problem was solved.
In my case, it was caused by an adb glitch, not a flutter problem.
This was solved by doing a combination of the following, not sure which step fixed it exactly
Reset adb server on desktop, macOS in mycase: adb kill-server, and then adb start-server
Reset USB debugging on the mobile device.
Restarted the device.
None of the existing answers worked for me, so it wasn't a flutter problem. A plain adb install any.apk didn't work. So I narrowed it down to an adb/usb issue.
this common problem with the Emulator and all you need to clear the Emulator cache .
in my case it was the solution...
1- open AVD Manger.
2- click on the (bottom arrow) that beside (Edit) button.
3- choose Wipe Data.
Sometimes it can work by uninstalling your app and and all it's data then try again,
another fix is to send the apk you are trying to install from projectname/build/app/outputs/apk and to your device and install it and try again.
Note: Following is answer for stuck at Performing Streamed Install by adb install xxx.apk:
phenomenon
use adb install xxx.apk and showing Performing Streamed Install but stuck, hang forever.
Have tried
re-plug USB cable
change USB adapter
change USB cable
reboot PC(Mac)
reboot android phone
restart VSCode
make adb command shorter
from: adb -s hxxxxxxxxs install -r /Users/limao/dev/xxx/crawler/appAutoCrawler/AppCrawler/task/20201202_xxx_0192LeiMoChuanShuo/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android_0.apk
to: adb -s hxxxxxxxxs install -r /var/folders/gt/5868sbcd1jq4rxvryqhy2_1sz8n0s3/T/tmpq3ypjfgd/20201202_xxx_0192LeiMoChuanShuo_gameApp_Android_0.apk
tried adb shell pm install but not support
etc...
all not work.
Final solution
update (original old version 29.0.5) adb to latest version (30.0.5)
Q: how to update adb to latest version
A:
goto
https://developer.android.com/studio/releases/platform-tools
to download your platform adb
下载适用于 Windows 的 SDK Platform-Tools
下载适用于 Mac 的 SDK Platform-Tools
下载适用于 Linux 的 SDK Platform-Tools
or:
goto
https://www.xda-developers.com/google-releases-separate-adb-and-fastboot-binary-downloads/
to download:
windows
https://dl.google.com/android/repository/platform-tools-latest-windows.zip
Mac
https://dl.google.com/android/repository/platform-tools-latest-darwin.zip
Linux
https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip to got folder platform-tools
add the folder to your PATH variable
eg:
vi ~/.zshrc
PATH=/Users/limao/dev/tools/android/adb/platform-tools:$PATH
In my case, this was resolved by updating android studio and all the flutter and dart plugins.
Go to File>> invalidate caches
By this way I resolved this issues on BlueStack.Do these steps for running android applications on BlueStack Emulator.
Go to setting of BlueStack Emulator
Then click on Advance and then
Turn on Android Debug Bridge (ADB)
I experienced this same problem on a physical device, tried all solution i could see out there but none worked.
What worked at the end of the day was to ensure my device API version was also installed in the android studio.
image1
image2
Forewords
This question gets the first result from Google, so my answer covers a bit different error.
The error in question has [INSTALL_FAILED_INSUFFICIENT_STORAGE] code. My answer is for any Performing Streamed Install error that does not specifically define [INSTALL_FAILED_INSUFFICIENT_STORAGE] code.
My Environment
KDE Neon 5.24 (a.k.a. Ubuntu 20.04 but latest KDE stuff)
Visual Studio Code from Snap (I use this mainly)
Android Studio from Snap (I use this to install SDK, Platform Tools and Build Tools)
Troubleshooting
The problem is this globally installed /usr/bin/adb overrides the adb that Flutter uses. As you know, Ubuntu has many outdated packages (to protect their system's stability). ADB is one of them. So, if you try to do:
adb kill-server
adb start-server
You will highly likely get an output similar to below:
* daemon not running; starting now at tcp:5037
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 12668
--- adb starting (pid 12668) ---
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Version 1:8.1.0+r23-5ubuntu2
adb I 03-26 03:19:35 12668 12668 main.cpp:57] Installed as /usr/lib/android-sdk/platform-tools/adb
adb I 03-26 03:19:35 12668 12668 main.cpp:57]
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:416] adb_auth_init...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:174] read_key_file '/home/erayerdin/.android/adbkey'...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:391] adb_auth_inotify_init...
adb I 03-26 03:19:35 12668 12668 adb_auth_host.cpp:467] Calling send_auth_response
adb server killed by remote request
* failed to start daemon
error: cannot connect to daemon
In some flutter run sessions, I've got an output similar to "adb server version (whatever) does not match the client (whatever); killing". That's when I had the doubt maybe I have installed adb globally. Check this:
which adb
# /usr/bin/adb
# This is a sign that this adb might be globally installed.
# This must be a symlink. Just to make sure, I do the following...
realpath /usr/bin/adb
# /usr/lib/android-sdk/platform-tools
# This is the evidence that it has been installed globally.
So, we use an outdated version of adb, which does not match the target device's adb server.
Solution
So, we need to get rid of this global adb first.
⚠ Warning
If you use adb from terminal, what we are going to do will remove it. You can add your {SDK PATH}/platform-tools where SDK PATH is where you have installed SDK to get it back.
Simply do:
sudo apt remove android-sdk android-sdk-common android-sdk-build-tools android-sdk-build-tools-common android-sdk-platform-tools android-sdk-platform-tools-common
However, doing these actually does not remove adb from the system. It still lays there for some reason, so, for the last step, we do:
# simply backup our symlink
sudo mv /usr/bin/adb /usr/bin/adb.bak
# and backup global android-sdk tools
sudo mv /usr/lib/android-sdk /usr/lib/android-sdk.bak
After these steps, you can restart your editor and try again. If you want to make double sure, you can optionally do (while your editor's closed):
# clean the build artifacts
flutter clean
# reinstall the packages because we have cleared them
flutter pub get
flutter pub get packages
Android 12 requires you to add a piece of code to your main activity
Go to your project folder and open the AndroidManifest.xml file
Add the below code in the activity
android:exported="true"
I was having the same issue with a physical device connected via wifi, then I figured out what was wrong. The battery of my device was below 15%, it worked as expected after charging. So, keep an eye on the battery status if you're working with a physical device via wifi.

Can't get React Native to work on Ubuntu

I am trying to get React Native running on Ubuntu 16.04. I have used it with create-react-native-app and expo on my Windows machine with both the Android Studio virtual device and a tablet connected by USB. Now I have a new Ubuntu laptop and a Ubuntu dual boot on my PC and am trying to set it up there but have failed miserably.
Let's deal with the laptop. Following the instructions, I have installed Expo and Genymotion. Expo could never work right so now I'm just trying to get it going more directly. I have also installed Java 8 and watchman. I've installed and tried too many things to mention. I've put in about 20 hours so far.
Here is what happens when I try to start things.
If I plug in my tablet, I get:
kevin#kevin-Kudu:~/programming/rn4$ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
5205132d4f9011af device
(As a side note, it seems that my adb server is always out of date.) When I try to run the default code installed by react-native-cli by running react-native run-android, I get:
kevin#kevin-Kudu:~/programming/rn4$ react-native run-android
Scanning folders for symlinks in /home/kevin/programming/rn4/node_modules (9ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
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
I've researched these errors and can't find a solution that works.
If I start an Android Studio virtual device (N6, API 23), it starts up. adb devices gets me:
kevin#kevin-Kudu:~/programming/rn4$ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
5205132d4f9011af device
When I try to run the app:
kevin#kevin-Kudu:~/programming/rn4$ react-native run-android
Scanning folders for symlinks in /home/kevin/programming/rn4/node_modules (9ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
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
Again, I haven't been apple to find a solution.
When I try to do the same thing through genymotion and do adb devices, I get:
kevin#kevin-Kudu:~/programming/rn4$ adb devices
adb server is out of date. killing...
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
I get the same result when I try to run the app.
Any ideas what I should try next? Please bear in mind that I am still fairly new to linux so please be specific. If you tell me, "Simply change the RX74 constant in the Fetzer config file" I'm not going to have any idea what you are talking about. (I've had bad experiences with linux advice that assumes that I know what every file on the system is and where to find it.)
Thanx in advance.
ADDENDUM 1 #Vigas Deep:
When I check which -a adb:
kevin#kevin-Kudu:~$ which -a adb
/usr/bin/adb
/usr/bin/adb
/home/kevin/Android/Sdk/platform-tools/adb
So I have more than one. I'll figure out why one is getting called twice, for now I just rename it, and now I get:
kevin#kevin-Kudu:~$ which -a adb
/home/kevin/Android/Sdk/platform-tools/adb
I fire up the Android Studio virtual device and check it:
kevin#kevin-Kudu:~$ adb devices
List of devices attached
emulator-5554 device
And when I try to run a RN starter app:
kevin#kevin-Kudu:~/programming/rn4$ react-native run-android
Scanning folders for symlinks in /home/kevin/programming/rn4/node_modules (18ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
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
Interestingly, when I try to restart the adb server, I get:
kevin#kevin-Kudu:~/programming/rn4$ sudo adb kill-server && adb start-server
[sudo] password for kevin:
sudo: adb: command not found
Does the adb in the SDK not have those commands?
Just for kicks, I reboot and try pluggin in a tablet:
kevin#kevin-Kudu:~$ adb devices
List of devices attached
5205132d4f9011af device
(But for some reason only shows up when plugged into the USB2 port, very inconveniently located.)
When I try to run the RN project:
kevin#kevin-Kudu:~/programming/rn4$ react-native run-android
Scanning folders for symlinks in /home/kevin/programming/rn4/node_modules (21ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
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
Sorry, that's all the testing I can do for now. Any other ideas?
ADDENDUM 2 #Vigas Deep:
"just to make sure that its using the adb located inside sdk; use this command for now: /home/kevin/Android/Sdk/platform-tools/adb devices"
OK, I get the same result whichever I use.
"and do not use sudo for adb command because we are not going to run react-native run-android as sudo."
OK. All the examples I saw used sudo to start and kill the adb server. Strangely, now it works without sudo but not with. Before, I think it was the opposite, but I haven't tried it without in a long time so I can't be sure.
"Also; are you using openJDK or oracleJDK ; how did you install the JDK?"
I thought I remembered going to the Oracle site, but when I do "java -version", I get:
kevin#kevin-Kudu:~/programming/rn4$ java -version
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-3)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
This would seem to indicate otherwise. Should I change it?
ADDENDUM 3 #Vigas Deep:
OK, I looked up how to remove openjdk and followed it. I found instructions about how to install the jdk8, just to be sure. I am getting the same error when I try to run the RN app. When I check java -version:
kevin#kevin-Kudu:~/programming/rn4$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
and
kevin#kevin-Kudu:~/programming/rn4$ readlink -f $(which java)
/usr/lib/jvm/java-8-oracle/jre/bin/java
When I check the jvm folder:
kevin#kevin-Kudu:/usr/lib/jvm$ ls
java-8-oracle
Just in case, here is my current $PATH:
kevin#kevin-Kudu:/usr/lib/jvm$ echo -e ${PATH//:/\\n}
/home/kevin/bin
/home/kevin/.local/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/home/kevin/bin
/usr/bin
/snap/bin
/usr/lib/jvm/java-8-oracle/bin
/usr/lib/jvm/java-8-oracle/db/bin
/usr/lib/jvm/java-8-oracle/jre/bin
/home/kevin/Android/Sdk/tools
/home/kevin/Android/Sdk/platform-tools
Any other ideas? Am I missing something? (highly likely)
ADDENDUM 4 #Vigas Deep:
OK, so completely removed Java, mainly following this.
I reinstalled it using this.
After some monkeying around with genymotion, I was able to get an app started on create-react-native-app that ran on genymotion.
Thank you #vigas-deep. If you're even in Oakland, I owe you a beer, or whatever your beverage of choice is. Thanx!
I have eight years of experience with Ubuntu and other Linux based OSes.
I think the problem is you are having multiple versions of ADB.
run the following command to know if that's right.
which -a adb
And if you have multiple versions of adb, just keep the adb version which is inside your android sdk and remove/rename others.
prefer rename just incase if you need those executables again.
I'd be happy to help more if needed.

ADB server version (36) doesn't match this client (39); killing [duplicate]

This question already has answers here:
adb server version doesn't match this client
(41 answers)
Closed 5 years ago.
After installing the Android O preview on a test device my ADB stopped working and started giving me this error.
adb server version (36) doesn't match this client (39); killing...
adb E 03-27 08:01:55 2925 147690 usb_osx.cpp:333] Could not open interface: e00002c5
adb E 03-27 08:01:55 2925 147690 usb_osx.cpp:294] Could not find device interface
error: could not install *smartsocket* listener: Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
The only answers I have come across on this issue referred to Genymotion being out of sync with ADB but I don’t use Genymotion. Any help would be greatly appreciated. I have already wiped and reinstalled Android Studio as well as all of its tools and settings yet seem to still have this issue.
This works for me...
go to GenyMotion settings -> ADB tab
instead of Use Genymotion Android tools, choose custom Android SDK Tools and then browse your installed SDK.
In my case this error occured when I set up my environment adb path as ~/.android-sdk/platform-tools (which happens when e.g. android-platform-tools is installed via homebrew), which version was 36, but Android Studio project has Android SDK next path ~/Library/Android/sdk which adb version was 39.
I have changed my PATH to platform-tools to ~/Library/Android/sdk/platform-tools and error was solved
The main point that all the others have missed, is that you will get this error when you have a running adb process in the background. So the first step is to find it and kill it:
ps aux | grep adb
user 46803 0.0 0.0 2442020 816 s023 S+ 5:07AM 0:00.00 grep adb
user 46636 0.0 0.0 651740 3084 ?? S 5:07AM 0:00.02 adb -P 5037 fork-server server
When you find it, you can kill it using kill -9 46636.
In my case, the problem was an old version of adb coming from GapDebug. If you got this with GapDebug, get out of it and then do
adb kill-server
adb start-server
because with GapDebug in the background, when you kill the adb server, GapDebug will start its own copy immediately, causing the start-server to be ignored
I had the same problem with Android Studio - adb server version (37) doesn't match this client (39). I fixed by the following solution :
In Android Studio go to Tools -> Android -> SDK Manager
In the SDK Tools tab untick Android SDK Platform-Tools, click Apply to uninstall.
I then renamed the folder Platform-Tools to Platform-ToolsOld
Then back in the SDK Manager re-tick the Platform-Tools to re-install.
As mentioned by others here, that you could have two adb's running ... And to add to these answers from a Linux box perspective ( for the next newbie who is working from Linux );
Uninstall your distro's android-tools ( use zypper or yum etc )
# zypper -v rm android-tools
Find where your other adb is
# find /home -iname "*adb"|grep -i android
Say it was at ;
/home/developer/Android/Sdk/platform-tools/adb
Then Make a softlink to it in the /usr/bin folder
ln -s /home/developer/Android/Sdk/platform-tools/adb /usr/bin/adb
Then;
# adb start-server
I had the same error. In my case, using Appium, I had two versions of ADB
$ /usr/local/bin/adb version 36
and
$ /Users/user/Library/Android/sdk/platform-tools/adb version 39
The solution was:
be sure that your $PATH in bash_profile is pointing to: /Users/user/Library/Android/sdk/platform-tools/
stop the adb server: adb kill-server and check Appium is stopped.
delete the adb version 36 (or you can rename it to have a backup): rm /usr/local/bin/adb
start adb server: adb start-server or just starting Appium
You have two versions of ADB
$ /usr/local/bin/adb version
Android Debug Bridge version 1.0.36
Revision 0e9850346394-android
and
$ /Users/user/Library/Android/sdk/platform-tools/adb version
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
You could see which one your PATH is pointing to (echo $PATH) but I fixed it with a adb stop-server on one version and a adb start-server on the other.
To add yet another potential solution, Helium by Clockworkmod has it's own version of ADB built in that kept being started. Exiting the Helium Desktop application resolves the issue.
I think you have multiple adb server running, genymotion could be one of them, but also Xamarin - Visual studio for mac OS could be running an adb server, closing Visual studio worked for me

ADB server didn't ACK on macOS

I am getting this error since two days ago when I updated my Android Studio to the latest stable version 2.3; the full error message I am getting from Gradle Console is:
07:59:59 E/adb: error: could not install *smartsocket* listener: Address already in use
07:59:59 E/adb: ADB server didn't ACK
07:59:59 E/adb: * failed to start daemon *
07:59:59 E/adb: error: cannot connect to daemon
07:59:59 E/ddms: '/Users/USER_NAME/Library/Android/sdk/platform-tools/adb start
server' failed -- run manually if necessary
My attempts to solve the issue:
kill all adb processes and make sure no process is holding port 5037, adb kill-server (says * server not running * even in cases when adb is running), close Android Studio, delete ~/.android directory, run adb start-server (says * daemon not running. starting it now at tcp:5037 *; * daemon started successfully *, start Android Studio and run application, MAC throws error adb quit unexpectedly and gradle console shows same the error I posted above.
uninstalled and deleted all Android Studio stuff (except for projects directory), restarted MAC, installed fresh and latest android studio.
increased gradle vm ram org.gradle.jvmargs=-Xmx1536M in project gradle.properties
uninstalled antivirus and restarted the mac
Environment:
OS: MacOS Sierra 10.12.3
Android Studio: 2.3
buildToolsVersion: '25.0.0'
Android Debug Bridge version: 1.0.39
Address already in use means you have another instance of adb running.
Check your system variable $PATH and $ANDROID_HOME and local.properties file (of your project) and your .bash_profile . Make sure that all of these has same android sdk path. Then try restarting the adb server.
adb kill-server and adb start-server.
I read that you killed the adb, but as this answer says How to resolve the "ADB server didn't ACK" error? did you do that from the platform-tools folder? If your answer is yes, update the Android SDK to the lastest version via the SDK manager and update the $ANDROID_HOME
I hope it helps!
I usually find this issue occurring when I have two instances of ADB working, i.e when I have my Eclipse and Android studio running at the same time AND when they point to different SDK Manager(platform-tools folder) on the system. Try to search for what other IDE is using ADB, kill it in the Activity Monitor and run only one instance. Or my work around was to have only one SDK Manager and point both my IDEs to one platform-tools folder.
Hope that helps.
In my case, I had an old version of adb installed using brew cask. And while I updated my Android Studio to the latest, the adb was still pointing to the brew installed older version.
So after updating that version, using:
brew cask install android-platform-tools
And making sure that the adb itself was pointing to the new version, the errors went away.
Just write down platform-tools path (/Users/USER_NAME/Library/Android/sdk/platform-tools)
In the .bash_profile file, located at (/Users/USER_NAME/.bash_profile), like this :
export PATH="$PATH:/Users/USER_NAME/Library/Android/sdk/platform-tools"

ADB not responding. You can wait more,or kill "adb.exe" process manually and click 'Restart'

I have installed Android Studio.
Then I have updated the Android SDK.
Now when I start Android Studio, this message pops up:
ADB not responding. You can wait more,or kill "adb.exe" process manually and click 'Restart'
The dialog has 3 options: Wait more, Restart and Cancel.
But all of them
gives me the same result, i.e. a message Waiting for ADB appears and I can't do anything with Android Studio.
I have to kill the program using windows task manager! I'm using windows 7.
Can anyone help me on this?
Go to
Tools > Android > (Uncheck) Enable ADB Integration
(if studio hangs/gets stuck end adb process manually)
then,
Tools > Android > (Check) Enable ADB Integration
On my macbook pro, i was occasionally getting this in Android Studio. The following resolved it for me:
Open up a Terminal and, instead of using 'adb kill-server', use this:
$ killall adb
wait a minute and it looks like Android Studio automatically restarts adb on it's own.
From the command prompt run the command adb kill-server. This will shutdown ADB and android studio or Eclipse if you were to use that, would show Waiting for ADB as you said.
Once ADB has shutdown down run adb start-server or run adb devices which will automatically start the adb service and show that your android emulator or development devices has successfully connected.
If you are suffering from "ADB not responding. If you’d like to retry, then please manually kill ‘adb’ and click ‘Restart’ or terminal appear Syntax error: “)” unexpected"
then perhaps you are using 32bit OS and platform-tools has updated up 23.1.
The solution is to go back to the platform-tools 23.0.1.
You can download the platform-tools 23.0.1 for Linux here , for windowns here and Mac here
After the download, go to your sdk location > platform-tools folder to delete old platform-tools in sdk and paste down into the downloaded one.
Woohooo ... it should work.
This is a bug with latest ADT.
For me, on Windows 7, killing the ADB server and restarting it via command line did not help. It would not start up successfully.
>adb kill-server
>adb start-server
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK
* failed to start daemon *
So killing the adb.exe process via Task Manager was actually the easiest solution that case.
Check if any service is listening on port 5037, and kill it. You can use lsof for this:
$ lsof -i :5037
$ kill <PID Process>
Then try
$ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This solved my problem.
I ran into this problem and tried a number of solutions on my Mac without any success. I finally got to work with the commands below:
$ rm -rf ~/.android
$ killall adb
$ adb devices
Note that rm -rf ~/.android will remove any AVDs that you have configured, so don't take this step lightly. Personally I had to though and I'm not sure why. Hopefully this helps someone.
This issue could be because adb incompatibility with the newest version of the platform SDK.
Try the following:
If you are using Genymotion, manually set the Android SDK within Genymotion settings to your sdk path. Go to Genymotion -> settings -> ADB -> Use custom SDK Tools -> Browse and ender your local SDK path.
If you haverecently updated your platform-tools plugin version, revert back to 23.0.1.
Its a bug within ADB, one of the above must most likely be your solution.
I run netstat -nao | findstr 5037 in cmd.
As you see there is a process with id 3888. I kill it with taskkill /f /pid 3888
if you have more than one, kill all.
after that run adb with adb start-server, my adb run sucessfully.
1.if your phone system is over 4.2.2 , there will be
2.disconnect the USB and try again or restart your phone
3.After after all try , it didn't work. It may be a shortage power supply so try other usb interface on your computer.
I solved the problem doing the first step . anyway have try.
If you need to kill all adb processes on windows with one command, you can do it as follows:
taskkill /F /IM adb*
I had this problem and solved it by this way...
I had a app in my pc that used adb...
I tried to disable it but still my android studio's adb had problem
after unistall that application and problem solved.
I had the same problem. I have restarted ADB in any possible way, I have killed the process and restarted the PC with no results.
Then I found this plugin. Just download and install it in your Android Studio IDE. Under Tools -> Android you have a menu ADB Idea. Here you can kill, start, restart, clean ADB.
None of the above helped me completely. Although Oventoaster made me think. I had a couple of adb on my system. Removed them almost all.
I am running android studio on ubuntu 14.04 64 bit.
So I checked manually /home/xxxxx/Android/Sdk/platform-tools/adb
where xxxxx was my linux username
this gave
/home/xxxxx/Android/Sdk/platform-tools/adb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
https://stackoverflow.com/a/27415749/4453157
solved it for me.
If the above CMD command option is not working and you cannot make it work in any other way then follow this below.
Click on below link
http://adbshell.com/downloads
and download the first link with name ADB Kits ( contains adb.exe and necessary .dll files).
After downloading replace these files with the ones in the path
Android/Sdk/platform-tools/
Now click on adb.exe and it will open cmd and will start the adb server.
Now it will detect the device and no problem. OOOOOllllaaaaa.....
If the Problem persists again then do the same... save the folder
somewhere.... just replace files... it will detect the device
automatically then
I had this problem on Windows 8, but I solved the problem by updating all of Android Studio's plugins with the SDK Manager, then restarting the computer.
An another one: you might want to avoid running Eclipse and Android Studio together, it helped me.
I had this problem on Windows 7. My situation is this through SDK Manager. I only download API 19 but I had not downloaded related Android SDK build-tools. So it occur this problem.
I went through SDK Manager download build-tools 19 to fix it. Hope to give you help.
Faced this issue on Mac:
I have tried different solution, But below works for me -
Uninstall "Vysor" plugin if you have installed for Chrome
Under Home folder > find .Android folder and move to trash
Goto, Android sdk > delete/move to trash platform-tools folder
Again install/download from Android SDK Manager
Open terminal -
adb kill-server
adb start-server
Check adb devices, It will work and display you all connected devices.
Hope it helps !
there seems to be about a million reasons this bug happens, but for me (running on ubuntu), it was openvpn running in the background that caused it.
I killed the openvpn service and no more issues.

Categories

Resources