Can't start Genymotion Emulator from Android Studio Plugin - android

I've seen many posts with a similar problem and tried many solutions but so far none have helped. This all started after I upgraded Genymotion from 2.5.2 to 2.6.0.
I'm using Android Studio 1.5.1 on Ubuntu 15.10 64 bit. The Genymotion plugin is version 1.0.7. VirtualBox is 5.0.12 r104815
When I try to start a Genymotion Emulator I get:
I have several machines defined and all do this.
However, I can start them from the Genymotion app.
One other piece of information...if I have Android Studio and Genymotion running I get the following error when I try to issue any adb command from the command line:
adb server is out of date. killing...
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error:
I've tried restarting the computer, restarting Android Studio, and removing and reloading the plugin. I've also set Genymotion to use the same adb that Android Studio uses.
Any ideas? Let me know if you need more info.
Thanks,
Rich

This is actually 2 separate problems and I've found the solution for one and a workaround for the other.
Can't start Genymotion Emulator from Android Studio Plugin - I resolved this for now by reverting to Genymotion 2.5.2. I'll still need to figure out why 2.6.0 causes a problem but for now I can start emulator machines from the Android Studio plugin.
adb server is out of date - This is caused by more than one instance of adb on the machine. In my case, Android Studio was using the one in ~/Android/Sdk/platform-tools, but when I tried issuing adb commands in terminal it was using the one in /usr/bin. I'll either try creating a symbolic link in /usr/bin to point to ~/Android/Sdk/platform-tools, or I'll add ~/Android/Sdk/platform-tools to my Path environment variable.
Rich

Related

After Android Studio 3.3 upgrade, so my APK's will build but not not run

After installing i get a Disconnected emulator-5556 message, while im running a different emulator (on 5554).. Even when i don't have any emulators of devices running!
I tried deleting all my AVD's
Wiping AVD data
adb kill-server && adb start-server
AS restart
Created a new user profile on my Mac to see if that helped..
Re-installed SDK Platform tools
When i launch my app via run. The device selector shows this. Is this way since a long time and didnt interfere with my work in AS 3.2. But after upgrading to AS 3.3 i cant run apps anymore
But nothing works, anyone ran into this issue before?
For if someone runs into this in a couple of years. I tried a couple of commands and the ghost emulator magically disappeared...
First command (to see if a process is doing something with adb)
ps aux | grep adb
Second command (to see if files are opened by a process)
lsof -nP -i4TCP: 5556 | grep LISTEN
Shouldn't have worked, but it stopped the blinking emulator for me..
No worries, just go to SDK manager and check if the Update is Available for the SDK Platforms, or SDK Tools. this usually happens when we use previous versions and sudden date to the new version of android studio and tools or platforms are not ready or updated with that version. Android has the version compatibility issues.image
I had the same issue after upgrading to Android Studio 3.3. In my case I had the Videostream app on my Mac and it was competing for port 5556. Uninstalling /Applications/Videostream and killing the process freed up port 5556 and everything started working for me again.

Error while trying to push/install .apk using adb

I've recently started encountering problems while trying to run my application from Android Studio on my MacOS machine. I tried to run the command from adb myself but I still can't get it to work, although the error appears different.
The errors I get are as follows;
Android Studio
10/02 09:54:53: Launching app $ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
java.io.IOException: Broken pipe
Error while Installing APK
adb (via Terminal.app)
$ adb push /Users/{username}/{path-to-apk}.apk /data/local/tmp/{package}
adb: error: 65536-byte write failed:
Undefined error: 0
Now I've tried a lot of different things, some of which are just stretches because the problem appears to lie in something adb related, but none of this seems to change anything;
Different applications/apks
Different Android devices (total of 5)
Different USB-ports (all 4,
with and without USB-hub).
Different (or no) USB-dongles (USB-C to USB-A)
Restart/Invalidate Caches (Android Studio)
Reinstall Android Studio
Reinstall Android SDK
New (separate) install of Android SDK through homebrew
Reset NVRAM/PRAM
Reset SCM
Update to MacOS Mojave (and retry all of the above).
At this point I am at a loss. Has anyone encountered these errors before without having any of the above solutions fix it? Next thing on my list is a reinstall of the OS, but that feels like a bit of overkill.
I am running on MacOS Mojave on a 2016 Macbook Pro, but everything appeared to have the same effect on High Sierra.
Edit
Weird update on the behaviour, I can get the installing to work continuously after a restart by doing the following steps;
Login
Start Terminal.app
Manually repeat adb push command
(Command executes successfully)
Start Android Studio
Everything works fine...
However, if I start Android Studio without first manually doing the adb push in Terminal, everything is broken as described above.
Edit 2
Even calling adb start-server in Terminal before starting Android Studio makes everything work. So something appears to be faulty when Android Studio is responsible for starting the adb server..
I got the same error. I have no idea but start-server before starting Android-studio
Restart adb with the following command,
adb kill-server && adb start-server
Not really an answer but my issue appears to be solved with the latest release of Android Studio.

OSX: Android studio emulator not showing up in adb devices or Logcat window

I am currently on Android Studio 3.0.1 and OSX 10.13.1
This is a screenshot of the problem
I have tried all the following things:
killing and starting adb server (adb kill-server and adb start-server)
Enable and Disable adb integration with android studio
Added android-sdk/platform-tools and /tools paths to ~/.bash_profile
I have created multiple emulators - wiped their data, etc
Have unistalled/installed android sdk platform tools multiple times; even done the same with HAXM installer
restart android studio and my system
The interesting thing is that I can see the devices
when I connect to deviceConnect (https://mobilelabsinc.com/resources/videos/deviceconnect-demo)
This software was closed while I was trying out with the emulator, I have checked in activity monitor too to make sure.
I still cannot see my emulator in either "adb devices" or logcat window.
Side Note: I see here: ~/.android/avd/: the emulators that I have created, I feel somehow this needs to be linked to the android avd? I have spent wayyy too much time on this!!
Any help would be highly appreciated!
This is caused by the deviceConnect/deviceBridge tool from mobilelabsinc that you are using. You only have one option: uninstall the deviceConnect/deviceBridge tool.
Just moving the deviceConnect/deviceBridge tool to the trash will not work. You will need to use a tool like AppCleaner(https://freemacsoft.net/appcleaner/) to remove it. Once you have removed the tool, it should solve your problem (Might need a reboot!).

Open Android Device in Genymotion from Expo XDE gives error

I am using Expo XDE version 16.0.0 and I would like to test my app in the Android emulator. I am on a mac. I have installed Genymotion and have started the emulator as the expo.io (https://docs.expo.io/versions/v16.0.0/guides/genymotion.html) docs describes but I get the following error. I have no idea of what it means or how to fix it.
Couldn't start project on Android: could not install smartsocket. listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon
I hope someone can help me on this one?
In my case the solution was this on an Ubuntu 17.04
sudo apt remove android-tools-adb
adb kill-server
adb start-server
it's possible you have adb and android-tools-adb installed
After having spent a day figuring it out, I decided to go with using the Android emulation within genymotion. This is for Ubuntu (16.04).
Download Android Studio & go into Tools > Android > AVD Manager.
Download the SDK for whichever device & Android version you are going
to use.
Once downloaded, test the emulator is functional by clicking
on the green play icon under 'actions' (far right in Virtual Devices
screen).
Open genymotion, settings > ADB > 'use custom Android SDK
tools'. Select folder /*/Android/Sdk (wherever Android sdk is
installed)
Test by clicking on 'Start' in main genymotion screen.
Open Expo XDE, load up the project & 'ctrl+d' to load on android
device. It will start the installation of expo app.
vividresponse here worked for me even on linux (he made it on OSX and I see it works for windows too).
Basically, you must check the versions of adb. Like:
adb version
And (using you real path)
/opt/android-sdk/platform-tools/adb version
If they differ, replace /usr/bin/adb (first one) with the second one.
Other important things are that you must set the correct genymotion SDK. And make sure sdk & sdk tools must be present in the PATH variable.

adb socket not working and daemon

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

Categories

Resources