Whenever I try to run my new Application, at initial the emulator start but after some time the process stops and it show me an error like :
Failed to install LoginUsingJSON.apk on device 'emulator-5556!
LoginUsingJSON] (null)
LoginUsingJSON] Failed to install LoginUsingJSON.apk on device 'emulator-5556': EOF
LoginUsingJSON] com.android.ddmlib.InstallException: EOF
LoginUsingJSON] Launch canceled!
And after 10 or probably 15 attempts the same application runs normally.
I'm facing this problem every day regarding the emulator.
What should I do to fix this issue ?
This sounds a lot like you want to deploy the app at the moment the emulator launches, which is failing. Then after some retries (when the Emulator is up), it will succeed.
Just start the emulator once at the start of your hacking session and only when it shows the normal login screen deploy your app to it.
There is no need to shut down / restart the emulator for each deploy.
Related
I'm working on Phonegap for few days. Before this I was able to run phonegap apps into emulator through command line successfully, but now that's showing a peculiar hang; nothing happening no error, no flow of execution.
Now I'm running my apps by installing the .apk file directly through Android command line. But, still I want to know why it's not working, why this run command hangs there?
In my case ADB DEVICES displayed me invalid devices, an ADB KILL-SERVER solved this for me.
i suspect that is was caused by a my laptop going into sleep mode.
when it says trying to install app onto device the command is actually running adb install C:/yourpath/yourapp.apk which copies the app the android installation.
You shouldn't worry if it takes a long time. The installation is proceeding as planned, just be patient. The bigger your app, the longer is takes. For me a ~300MB app takes a full 7 mins to install to an attached device via USB. And the same app will take 13 mins to install to an Android emulator.
The emulator is known to be slow, there's a big SO thread regarding this issue here - Why is the Android emulator so slow? How can we speed up the Android emulator?
I've checked every single related post (I know there're a lot) but still no one common solution works for me.
Almost every time users solve this issue by:
adb kill-server
sudo start-server
But not in my case. I do that and nothing happens. Nevertheless I cannot run my App in emulator, I can do it in normal physical device and it works!
I'm on latest OS X (ML). Latest for today sdk, adt, eclipse(kepler). Everything is up to date.
When I check adb devices, it's empty. Or when I switch to DDMS - same.
When running an app, it's starting displaying normal messages in console:
[2013-07-03 18:59:42 - NewApp] ------------------------------
[2013-07-03 18:59:42 - NewApp] Android Launch!
[2013-07-03 18:59:42 - NewApp] adb is running normally.
[2013-07-03 18:59:42 - NewApp] Performing vista.Start activity launch
[2013-07-03 18:59:49 - NewApp] Launching a new emulator with Virtual Device 'Hihi'
But after, the unlock screen is shown, the app appears to be not installed on the emulator.
I've tried different API levels and also reinstalled all eclipse, adt,etc. As well as deleted and recreated the virtual device.
The thing I've noticed is that the debug mode is OFF in the emulator. And if I change it and run again, it still OFF.
I'm really sorry for reposting, but I couldn't find exactly the same problem description.
PD: The other thing I've noticed is that sometimes eclipse prompts for something to allow or not with warning window. But it appears/disappears so fast that there's no time to read and answer.
Do I have all correct paths?
~/android-sdk-macosx/platform-tools/adb
~/android-sdk-macosx/tools/emulator
~/.android/avd/
/Applications/eclipse
keep your emulator on.. and reset your adb from device view
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Android error: Failed to install *.apk on device *: timeout
keep getting error messages when I try to launch any mobile app with android. These errors are not predictable - sometimes (like once out of 10 times) a miracle happens and everything works. But most of the time I get this error:
[ERROR] C:\Program Files\Titanium Developer\android-sdk-windows\tools\adb.exe
error: protocol fault (no status)
followed by this error later on:
[DEBUG] Waiting for device to be ready ...
[TRACE] adb devices returned 0 devices/emulators
......
[ERROR] Timed out waiting for emulator to be ready,
you may need to close the emulator and try again
The emulator starts and I get the locked screen but somehow the connection with it is lost.
I tried launching the emulator separately from a batch file as someone else suggested before I open the ti developer but I get the same errors.
Even if it runs correctly once, if I make changes and want to relaunch (without stopping or closing the emulator) I always get the errors above. I thought we are supposed to be able to keep reusing the emulator once it's up and running but for me it never works like that.
When i try to run from eclipse it used to give the following message Failed to install Demo.apk on device 'emulator-5554': timeout
I want to run the same application without killing adb server or without closing the emulator again.
Please any help would be appreciated lot!!!!!!!!!
That's because the default ADB idle time out is 5000ms.
Take Window -> Preferences -> Android -> DDMS. Increase your ADB time out. This will solve your problem
Delete the .android folder from your home folder of user after closing eclipse and emulator and then restart and try. It should resolve your problem. After deletion you will have to set the sdk of adt plugin.
From past 1 hour,I am unable to launch my application on Eclipse-Helios and the console on my Eclipse gives the following error:
[2011-11-21 10:37:00 - PagingScrollerExample] Failed to install PagingScrollerExample.apk on device 'emulator-5554': timeout
[2011-11-21 10:37:00 - PagingScrollerExample] Launch canceled!
I had come across the same problem before,but whenever I perform Project->Clean process I could overcome this sort of problem.But today I don't know what has happened.I performed the Clean process and uninstalled the same application on my Emulator which was running before as well.
Could anyone sort out this problem for me and most importantly I would like to know what would be the reason for this?
I am using Android-2.2 as a target for this application.
You may have to increase the ADB connection time out. In the Eclipse--> Preferences--> Android---> DDMS, increase the ADB connection time out to 10000. By default it would be 5000.
Please try this. Hope it would help.
Try closing your emulator. and launching it again.. i know its tedious process.. but it works.. :)
I Got this type of error when Run a program on emulator.
ERROR: the user data image is used by another emulator. aborting
Exit from eclipse and ADB , and watch your task manager that how much emulator is running. is there anymore then one then close it and restart the eclipse and start ADB.
reboot your computer, this happens when the ADB bridge crashes sometimes.
I've found that stopping and restarting the emulator (and perhaps Eclipse) will fix it - less drastic than rebooting.