Virtual device not showing up in Android Studio - android

I am a total newbie in Android Studio programming.
When I click the Run button to run my program, my virtual device doesn't show up in Select Deployment Target and I get the following error:
18:08:32 error: Invalid argument: cannot open transport registration
socketpair
18:08:32 could not read ok from ADB Server
18:08:32 * failed to start daemon *
18:08:32 error: cannot connect to daemon
18:08:32 'C:\Users\samarc\AppData\Local\Android\Sdk\platform-
tools\adb.exe,start-server' failed -- run manually if necessary
What should I do? This seems to be the only thing that is stopping me from programming in Android Studio. Any and all help will be appreciated. I use Android Studio 2.2.3 and Windows 7 x64.

Just check there might be an existing adb process running in your task manager. Just kill the process and run the 'adb start-server' command.
Other Method:
Close android studio and the emulator and check in your task manager for another adb process and kill it if one exists.
If you have done it open Android studio again and first of all start the emulator and if it is running then your project.
You can even do it manually:
adb kill-server
adb start-server
Hope it helps

One may need to delete *.lock file from the Android main folder location and then at the subfolder as follow Android InstalledPath.android\avd\Nexus_5X_API_26.avd
If you are not able to delete the file and then try deleting the corresponding *.exe process from the task manager and then run the Android studio again and then AVD Manager. Select the virtual device (which shows available in play store)

Related

Android Studio returns error "Installation failed due to: ''cmd package install-create..."

I'm working on an Android App in Android Studio.
After updating Android Studio to Bumblebee 2021.1.1 Patch 2 it has stopped working.
Now I get the following error:
Installation did not succeed.
The application could not be installed.
List of apks:
[0] 'D:\Filer\Dokument\...\app\build\intermediates\apk\debug\app-debug.apk'
Installation failed due to: ''cmd package install-create -r -t --user current --full --dont-kill -S 4617721' returns error 'Unknown failure: cmd: Can't find service: package''
Retry
Failed to launch an application on all devices
Any ideas how to solve this?
The problem is most likely with the Android Emulator in Android Studio.
If you do a Cold Reboot of the Android Emulator it will most likely solve your problem.
Open the Android Studio Device Manager from Tools -> Device Manager.
Close the Android Emulator if still running.
Click on the Android Emulator's Device Menu ▼ located on the right hand side in the Device Mananger and Choose Cold Boot Now.
Now, try to run the app again...

Android Studio Application Installation failed

Sometimes when I go to build and test my apps I get this error and it drives me off the wall. I never had to deal with this before.
Installation Failure
com.android.ddmlib.InstallException: 'cmd package install-create -r -t --full -S 2816556' returns error 'Unknown failure: cmd: Can't find service: package'
I tried following this guide here
Application Installation Failed in Android Studio
I did all the suggestions disable instant run, build apk then rebuild app, restart computer, restart android studio, use different virtual device.
Idk anymore any ideas? I am using Android Studio 3.4.1
Update: Fixed it my issue sorta. If i first launch my virtual device and get it loaded. Then run my app the error doesn't pop up. This leads me to believe that Android Studio will throw the installation error because it can't run the app on the virtual device since it takes forever to load on my laptop

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

Android Studio Unknown Emulator running and can't be terminated

I have one emulator actively running at the moment but I see two emulators running when I run the app. One of them is an Unknown Emulator.
When I choose the Unknown emulator, the console shows this error:
Error: Could not access the Package Manager. Is the system running?
How do I terminate this Unknown Simulator? I think it's using my system's resources and degrading the performance.
Well, it was the BlueStacks emulator running in the background. Android Studio automatically detects it. The unknown simulator was there because BlueStacks was running in the background at the Notification Tray in my windows 8.1
When I closed BlueStacks from the Notification Tray, the Unknown emulator vanished for good.
First reason if your emulator in offline.
To resolve this you need to run command kill-server from adb.
Open Command prompt->navigate to android sdk-> go to platform-tools-> adb kill-server -> adb start-server
You need to run above command to remove unknown
Second reason if your project configuration not match with emulator configuration
Change your emulator configuration with your project requirement. May be your application version not match with emulator configuration
It was very simple to fix for my case :) Just need to type the following 2 commands using CMD:
adb kill-server
adb start-server
Make sure that the windows PATH variable contains "adb.exe" file's directory location. Normally, it should be:
YOUR_PATH_TO_SDK\platform-tools
//For example: D:\sdk\platform-tools

Not able to install android application on emulator

I was developing a “hello world” android application using intellij IDE 11.0.01 and android SDK 4.0.3.
I ran the application using intellij, emulator was launched but it was not showing my application. Android logcat was also empty.
I closed the emulator. Killed the process adb.exe from task manager.
Then I followed the following steps:
1.Copied the .apk file to android \platform-tools folder.
2.Started the emulator from SDK manager.
3.Open the command prompt and changed the path till \platform-tools folder
4.Execute the commands:
adb kill-server
adb start-server
adb install my_app.apk
I am getting following error:
** daemon not running. starting it now on port 5037 * * daemon started successfully * ** daemon still not runningerror: cannot connect to daemon
I am using Windows XP Professional Version 2002 Service Pack 3.I am working from my personal laptop and I do not have any antivirus or firewall started.
Could anyone please provide me information how to proceed from here?
If all fails, you could try installing the apk using adb:
adb install <path_to_apk>
Execute that commmand in a command window in the same folder as adb.

Categories

Resources