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.
Related
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.
I'm using genymotion 2.8.1 and android studio 2.3.1 and my OS is OSX 10.12.3. I have my Android SDK setup in ~/Library/Android/sdk. I've pointed genymotion to the same and my Android studio local.properties also to the same.
But when I start up genymotion device and try to run adb I just get an error saying the socket "5037" is already in use. When I run ps -ef | grep adb I get the following
505 2532 1 0 2:08PM ?? 0:00.70 adb -L tcp:5037 fork-server server --reply-fd 5
So I'm assuming this process was started by genymotion when trying to connect to the device. But when I run adb devices from the same path (I checked what path the adb process was running was from using the activity monitor) it throws this error
List of devices attached
* daemon not running. starting it now at tcp:5037 *
error: could not install *smartsocket* listener: Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
So can someone clarify what is happening here ? Is this a issue with this version of Genymotion and should I try downgrading it ?
So finally after lot of mix and match I found out that the issue was with the latest ADB version. Download this older version of the platform tools for mac - platform-tools_r25.0.3
Then goto where your sdk folder is and replace the platform-tools with the extracted platform-tools from the above mentioned package. Hope this helps others facing the same issue
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"
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.
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.