Emulator problem in Android - android

When I launch the emulator I face many problems (Errors):-
HttpConnectionApp]emulator-5554 disconnected!
Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'!
Emulator]emulator: ERROR: the user data image is used by another emulator.
aborting
Each time I have to re-run it but all in vain.
How can I improve this so that I can re-run the application on same AVD?

I had the same issue after my computer locked up and I had to power cycle it.
Wiping the user data didn't fix my problem, I had to delete the following folders manually
C:\Users\%UserName%\.android\avd\AVD2.1.avd\cache.img.lock
C:\Users\%UserName%\.android\avd\AVD2.1.avd\userdata-qemu.img.lock

A quick-fix that obviously works is to restart the adb server each time this error occurs:
adb kill-server && adb start-server
Then, you simply run the application again (without restarting AVD) and that's it.

Run configurations → Target → Wipe user data → Run.
It fixed the problem in my case.

Here is the answer that helped me:
link text
Another solution for me is start the avd manager and start once emulator from there. After that everything turns to normal.

AFAIK, this happens when an emulator is started, but the Android Debug Bridge couldn't establish connection to it.
If you have just started the emulator with your application, watch if you get Waiting for HOME to launch... or something similar in your Console.
If you don't get that message, but the emulator has been started, chances are, you'll get into the ERROR: the user data image is used by another emulator situation again.

emulator: ERROR: the user data image is used by another emulator. aborting
Tried restarting the computer as I had done a lot of messing around earlier but no joy same error.
Went to shut down ADB so as I'm on XP I run > cmd then paste in > cd C:\Program Files\Android\android-sdk\platform-tools (the location of the location for the ADB on XP)
Tried
adb kill-server && adb start-server
Then moved the directories cache.img.lock and userdata-qemu.img.lock in the C:\Documents and Settings\.android\avd\ to a New folder (instead of deleting)
This worked fine.

Delete the existing emulators and then make a new one.
This worked for me, when I had this problem and couldn't find the folders to delete.

Under Run Configurations --> Target --> Add Command Line Options add this
adb kill-server && adb start-server
every time running your App will kill-restart the adb server.

It's probably a bad install of ADT. Try uninstalling the plugin, restarting Eclipse, then installing it again fresh.
That of you aren't letting the emulator boot all the way up and are closing it before ADT/ADB can install/run your app.

Please set wipe_data for emulator
Use same instance of application (after modification if any) to avoid error you are getting.

This can also happen if you're using a network share as your home folder, because some network file sharing systems may lock the image files.

Delete the directories cache.img.lock and userdata-qemu.img.lock (in my case these files are in /mylocalusername/.android/avd/avd7.avd

Thanks for this! Just to add for some people who develop in Windows XP.
The path to the avd directory can be C:\Documents and Settings\.android\avd
Thanks again for the answer! :)

Related

Emulator: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature

I removed the emulator and reinstalled it and got the same error.
Emulator: emulator: ERROR: Running multiple emulators with the same AVD is an experimental feature.
Emulator: Process finished with exit code 1.
Removing the .lock files did the trick for me. Find the avd and remove the lock files. In a Mac .android/avd/'NAMEOFAVD.avd directory . The files I removed were hardware-qemu.ini.lock and multiinstance.lock.
It can be solved using this method. It worked for me.
Follow the steps:
Open Android Studio.
Go to AVD Manager.
In the Actions column, for the respective avd, click on the down arrow and click on Stop.
This will stop the Emulator and then you can restart it from the command line.
This means that your AVD manager thinks that your emulator is running. It thinks that because it sees lockfiles in your avd directory. If your emulator is not running they you can (should) safely delete the lockfiles here :
$ rm $HOME/.android/avd/<name-of-your-avd>.avd/*.lock
Same emulator error
ERROR: Running multiple emulators with the same AVD is an experimental feature.
fixed with removed lock for AOSP device which located
./out/target/product/generic_car_x86_64/multiinstance.lock
./out/target/product/generic_car_x86_64/hardware-qemu.ini.lock
Also check permission for /dev/kvm
On Linux, you should try this:
sudo rm /home/${USER}/.android/avd/*/*.lock
On Mac:
rm $HOME/.android/avd/*.avd/*.lock
Hope it will help.
Make sure you don't have any physical device connected to your computer, in addition to removing all emulators' .lock
Removing the cache could help
sudo rm /home/${USER}/.android/avd/*/*.cache
The very simple solution which is working all the time is to stop the emulator before launching the new project. If this error comes back you make a duplication of the AVD and delete the old one and run the new one. It works all the time.
just open your task manger, look for adb.exe, end task of all abd.exe extensions and restart your emulator.
my problem solved by closing the emulator and letting the test run the emulator automatically
I faced the same issue, I tried all the solutions above not fixed,
then I used the wipe data option from the device manager then it works fine.

android: Installation Error:Unknown Failure-while running an apk file in

Yesterday I haven't got any error while using emulator but today I got this error check the image below. I have run as well as debugged many time but I am not getting the same error every time.
Error is popping up after installing the apk file. Please give the correct answer such that i can fix the emulator correctly and work on that
Now when I compile I got new error check the below image while shows
What I have to do ?
I was also facing this issue, I try this and works great.
adb.exe kill-server
adb.exe start-server
I don't exactly remember, but try to reset preferences by option in Windows tab.
Or create a new emulator and try to run your program again. If above things won't work then enable debugging on your android device and connect your device and run it to see if error persist.
Thanks
If running in eclipse, Please check the emulator settings..
This happens when AVD is already configured and a new andriod project is created.
So for this.. go to Run>> Run Congurations >> Target.. Select the AVD which is already configured and an option for choosing same AVD for future projects also.
This will start an emulator and thats it.. your application is up !!!
If You Running In Eclipse, Check Your Settings.
Run Configurations - Common - Select File In Standard Input And Output - Click
Workspace And Choose Your Project.
And Just Click Run.
Check if the package name contains an uppercase letter,If uppercase letters are included, change them to lowercase.it worked for me
Even I faced this issue. I used below steps for resolving the issue:
1] adb uninstall your_app_package_name
2] adb kill-server
3] adb start-server
restart the emulator/device after executing above steps.
Now try to run the application. That must work for you.
Reboot your computer. This has always worked for me.

ADB not responding. You can wait more, or kill "adb.exe" ... windows 8

When I try to test my Android application with an android emulator as always I now suddenly get an error message. I'm working with Windows 8. So far I tried the following things which unfortunately could not solve the problem:
reinstalling eclipse with android adt
reinstalling java
installing "android studios" first solved the problem but after one day mysteriously also here adb, stopped working with the error message given in the title " ADB not responding ...
furthermore I unsuccessfully tried out some advice from Mr. Google:
Stopping adb.exe via task-manager and restarting eclipse / android studios
"adb kill-server" then "start-server" via command prompt
setting the path to adb.exe as an environment variable
switching off any antivirus or firewall
starting the IDEs as an administrator
updating the IDEs
The only thing I can remember doing which may have destroyed adb on my computer for all times: I connected my motorola smartphone to my laptop and installed the motorola usb drivers but as I said the adb also won't work with the emulator.
Any help would be kindly appreciated. The issue bothers me for more than an entire day now. Maybe someone had similar problems on Windows 8 ?
On OSX helped:
Close Android Studio
Kill all processess using 5037 port
sudo lsof -i |grep 5037
sudo kill PID_NUMBER
Run adb devices from console
adb devices
Meanwhile the emulator is working again. I cannot definetly say what solved the problem. What It could be a combination of two things:
Deleting the hidden ".android" folder under C:\Users...
(Probably there was some malfunctioning automatically created code)
Deleting and recreating the Path variable to the folder with adb.exe ( ...\sdk\platform-tools\;)
Finally it could be a Windows 8 issue which I don't understand.
Try this,
Open a command prompt with administration permission and type
netsh interface tcp set global autotuninglevel=disabled
This worked for me
Edit: Windows only
Kill the adb.exe with a command prompt. Open a command prompt were your adb.exe is located and type
adb kill-server
Maybe HTTP Proxy blocked the localhost 127.0.0.1:5037
If you have config the HTTP Proxy, make sure to exclude the localhost like picture below
Also, port can also be blocked by the firewall and anti-virus firewall, please notice as well.
Try this,
at the prompt try adb kill-server
Start one of your AVDs
at the prompt try adb root
The prompt should say adbd is already running as root.
That should fix it.
In case it helps anyone else, for me the problem was related with the USB hub that the tablet was plugged into on the computer (unplugging the webcam which was in use fixed it).
I got the same error. Don't worry. I have an solution. Go to Task Manager. Kill the process called adb.exe. You will find 2 or 3 processes. Kill all of them. You are done. It will work.
I have the same problems. Verify port 5037 is free and ports 5555 to 5585 are available and never used by another process.
"ADB server sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585"
FROM: http://developer.android.com/tools/help/adb.html
To find out which process is listening on a port on Windows yo can use:
C:> netstat -an -o
FROM: How can you find out which process is listening on a port on Windows?
I had the same problem, here is my simple fix:
-Go to task manager in windows, look for adb.exe, and kill it
-Go to command prompt, and tap adb devices ==> it will automaticaly start adb daemon
I finally just restarted the computer, and that solved the issue for me.
Uninstall HTC Sync. Or disable it somehow.
Try to open adb from command prompt from directory location as <sdk>\platform-tools,
If adb file is missing try to re-install Android SDK with latest version,
And try to run again..
I think issues will solved, by this procedure.
I saw this on a Mac OS X.
I shut down Android Studio and ran adb get-state in the terminal. When I started Android Studio back up, the warning had gone away.
BTW, I did just try restarting Android Studio without any luck. I am sure a restart of OS would have fixed it too.
The same thing with the Asus Sync utility (with the both our Transformer's 700 and 701).
I think there is a USB-port conflict between ABD driver and Sync utility.
Exit from Sync utility resolve the problem.
Looks like this could be caused by a bunch of different issues. This just happened to me because I had my android phone device plugged in for USB debugging, then after a few hours (and multiple android studio/phpstorm restarts) I had to do unplug the device manually. Things started working again after unplugging.
I have faced this problem few days ago. When I opened my task manager it showing me two adb runnig. It may be because of I am using mobogenie for connecting my android phone for debugging application. This problem is because of moboginie and adt port conflict. then I have followed following procedure to sort out this issue.
!) close eclipse
2) Go to task manager and kill all adb processes.
3) Now go to platform-tools in android sdk
4)press shift+right click mouse and select "open command window here" option
5) type
adb kill-server
adb start-server
6)if server sucessfully started then start eclipse and then connect your phone
(Remember dont connect your phone before starting eclipse)
Following works for me every time:
go to File->Invalidate Caches/Restart
select Invalidate and Restart
And, You are good to go.

could not access the package manager. is the system running while installing android application

While installing the android application in the emulator I am getting the following error.
Please help me to resolve this error.
Error message:
emulator.exe -avd avd_name
adb wait-for-device
adb install path-to.apk
could not access the package manager. is the system running while installing android application....
You need to wait for the emulator to full start - takes a few minutes. Once it is fully started (UI on the emulator will change), it should work.
You will need to restart the app after the emulator is running and choose the running emulator when prompted.
As other have said, this error occurs because the emulator is still in the process of launching. An attempt to access the package manager, for the device, at this time causes an error.
It's just a simple timing issue. Here are the steps to avoid this error:
Wait until the emulator 'lock screen' is showing.
Run the 'app' again (^R in most IDE's).
Choose the running device (Should be the same emulator).
App should install without error.
In my case it was just that the emulator took 9 minutes to start. Wait until you see the lock icon on the emulator LCD. Or use actual tablet or phone.
Facing Same issues following Link helped solving the problem. The above solutions were not helpful for me.
deployment-failed-could-not-access-the-package-manager-is-the-system-running
By restarting server using CMD application was back to work. Open cmd (Run as administrator), open this
cd C:\Program Files (x86)\Android\android-sdk\platform-tools
(this path must specify your android-sdk installation folder )
Now, first write,
adb kill-server and then adb start-server.
Kill the process/server and restart it.! It worked.
You can avoid the error by setting default device before launching application. Launch the AVD before starting the app.
Once you see this error, wait for emulator to show lock screen. And then relaunch the app in your IDE and check the emulator again. It works for me always.
In Android studio, you can relaunch by clicking the green play button or ctrl + r.
If this error is gotten when using a rooted device's su prompt and not from emulator, disable SELinux first
setenforce 0
You may need to switch to shell user first for some pm operations
su shell
then re-run your pm command.
Same applies to am commands unavailable from su prompt.
The solution for me was to restart the IDE. I suspect that a slow emulator was hiding from view, blocking installation on my device.
Check your project build is in Debug mode not Release, I had some problem for debugging always I forget to change Release mode to Debug (Xamarin Users)

Failed to parse the output of 'adb version'?

I am running Windos 7 and Eclipse 3.5 and I don't know why I keep getting this error. When I try run the program it gives me:
[2010-02-13 23:09:41 - HelloAndroid]The connection to adb is down, and a severe error has occured.
[2010-02-13 23:09:41 - HelloAndroid]You must restart adb and Eclipse.
[2010-02-13 23:09:41 - HelloAndroid]Please ensure that adb is correctly located at 'C:\Users\Mohit\Documents\AndroidSDK\tools\adb.exe' and can be executed.
I even tried runing Eclipse and adb.exe as admin. What is going on? How can I fix this and start making Android apps?
turned off COMODO Defense+ module and all worked....
If you have comodo internet security installed, you dont have to shut this feature down:
run comodo settings
defense+
list active processes
add adb.exe to trusted processes
restart server: run "adb kill-server" "adb start-server"
EDIT: For user of Comodo 6.x
Open Comodo
Click Tasks Icon at right top
Click Advanced Tasks
Click Open Advanced Settings
Select Security Settings --> File Rating --> Trusted files from
left panel
Click on the upward arrow icon at the bottom
Click Add --> add the adb.exe
there you go :) Hope this helps
Yes i had the same problem after i had did the update,
however, i have just fixed it :)
TO FIX THE PROMBLEM:
in folder: \android-sdk-windows\
go to folder \platform-tools ; copy the files
and paste in to folder \tool
Restart the Eclipse
I messed with all the solutions provided above, but I found another one-
Try launching eclipse with administrator privileges
RUN AS ADMINISTRATOR
hope it'll do the job.
After installing 2.3 SDK I got adb inside D:\AndroidSetup\android-sdk-
windows\platform-tools directory. I had set this path in environment
variable and my problem is solved.
Two options to solve this problem on windows:
Option 1:
Close the eclipse, if it is running.
Run the command prompt.
Go to the tools location of the android sdk.
run 'adb kill-server'
then run 'adb start-server'.
start the eclipse.
Option 2:
Open the task manager.
kill the adb process.
start the eclipse.
Problem should be solved.
What it work for me and this was because I move from one eclipse to another is to re install SDK and then re install ADT again, remove completly from eclipse ADT and re install.
As illustrated by this thread, you may need to kill an exisiting abd process, or unblock the 5037 port (remnants of previous adb start attempts).
Try closing Eclipse, issuing a
'C:\Users\Mohit\Documents\AndroidSDK\tools kill-server' command from terminal and retrying.
If that still doesn't work, you could try opening Activity Monitor to see if there are any existing adb processes running, and kill them.
Hi, it's OK now, I'saw with the nestat - a command line that theer was several processus on the 5037 port. The port wich serves for the emulator.
Thanks
force to start sdk manager several times (try directly from the file explorer). when you could do that comodo may send a mesage. allow the issue. then start again the sdk manager and update.
update eclipse then.

Categories

Resources