I have a problem with the Android Emulator and its SD card. I am developing an application that writes files to /sdcard. Everything works fine, until I exit the emulator by clicking its close button. After restart the files are empty (size 0), but still in the directory. Of course, they have not been empty as long as the emulator runs.
This looks like a failed sdcard unplug, like with usb stick. But I am not sure, how the emulator treats the card exactly. I am starting the emulator from Eclipse, and get an error at exit, when I close the emulator.
The problem did not exist before I updated my Android plugin. I could use all my files after restarting the emulator. Moreover, the problem does not occur on the real thing. I am using the most recent Android stuff, and Eclipse 3.5.
I already tried deleting my emulators and creating a new one. I also tried shutting the emulator down with the red telephone button, but that did never complete. Of course, my app is not a service and has no threads pending at shutdown.
Any ideas, you friendly people out there?
I am currently seeing the same problem on mine using an API 4 emulator, but putting the apk on my actual android device it works fine. It only happens if I close the emulator and restart using "Debug As" or "Run As". My current workaround is to start the emulator before running / debugging my app... not shutting down the emulator prevents this from happening, although I wish I had a real fix.
The problem went away by itself. I have no idea, what caused the healing. I did not do anything particular. I just continued working.
Thanks for your attention.
Related
No emulators are currently running
Wrote a program in Kotlin. Everything was fine, everything worked. I turned on my laptop a week later. Launched Android Studio/AS/. The code opens fine. Only emulators do not display the phone. Writes that there are no working emulators. No reboots of either the system or the AS, updates with a full restart of the program help. I want to delete the device, Device Manager/DM/ also does not allow it, because DM says that it is now working. I can’t find any AVD services. In the Task Manager, I can’t find anything either.
Dear gurus advise what to do.
The next step is to reinstall AS. I just can’t reinstall AS every time the emulator freezes.
Thanks in advance.
By the way, as I have no choice I reinstall the AS that helps.
In the last 36 hours, I've managed to screw my eclipse settings .. from being able to run my app, to now not even launch the emulator properly.
I think it started when I modified the AVD's SD card size and added a camera. Since then I've deleted the AVDs and recreated them. But eclipse now takes 20-30 mins to launch the emulator, and fails while trying to install my apk. When the emulator finally runs, I can't find my app so its not as if its installing and only failing to launch.
Also I bought a new Alcatel Onetouch 918n phone. After some painful steps, I now see "Alcatel Android ADB interface" in Device manager. But I just can't seem to make this phone visible to Eclipse/ddms/adb.
I don't have many logs to paste here- not sure what I should include. HELP!!!!
Have you tried just creating a new virtual machine? A lot of times changing sd card values ect can make it take much longer to load as well, you can also export to the .apk and load it onto your phone manually to test (tedious).
I have written some codelines with libgdx in eclipse and want to run them on my android device.(It's a tablet)
But i cant find out how to do this.
I even cant run it on the android emulator provided by the android sdk. I get an error that the app stopped unexpectedly.
The app is working fine with the desktop launcher...
I hope someone can explain me how to get it working on the emulator or on my android device.
I saw somewhere that simply connecting my device via usb should be enough that eclipse is able to create an temporary app on the device, but this also didnt work.
Regards
1st of all, download SamsungKies[latest], to get and install proper USB Drivers. Its important that it should be the latest, cuz there was a bug in the previous versions.
Now that you have the drivers, simply connect your device to your machine IN USB DEBUGGING MODE.
Go to your main activity, and run.
If it launches in an emulator, close the emulator, and again in main activity, select run configurations -> Android Applications -> target -> always prompt to pick device.
Run again, and it should install and run in your phone/tablet.
NOTE:The activity closes in emulator because, by default, the emulator doesn't support OpenGLES emulation, its too heavy for your CPU.
i know its kinda late, but i hope it helps others:)
The emulator won't launch my apps even on a real device! I've tried every solution online, even reinstalling android sdk,ADT plugin. The app run SOMTIMES(4x to be exact) though, like awhile ago, when i got home i tried it again, and it run on my first try then i began working on the code again then i tried to run it, won't run again. Even basic apps like hello world won't run most of the time. I've set the run configuration to let me choose my device everytime, but even the device chooser wont show up(showed up once only), i tried waiting for 30 minutes(also tried the kill-server start-server) but it just wont run! my real device, or the emulator is listed on the DDMS perspective and there's nothing on console. please help, cause I've wasted 2 days for this already.
Have you also tried, taking the USB cable then disabling debugging and then enabling debugging and putting the USB cable back.
I remember this happen to me, so I did what I mentioned and surprisingly it works. Hope it work for you too.
Maybe you should try deleting your emulator and creating a new one. Make sure that all your settings are correct and that you are targeting the right OS version.
I've had quite a few problems with the emulator and wiping them and starting from scratch worked more often than not.
As for the real device, the first real hurdle is getting the right drivers so that your PC can recognize it, after that kill-server start-server usually does it. I'm surprise that didn't work for you.
I seem to get this error message fairly frequently:
INSTALL_FAILED_INSUFFICIENT_STORAGE
Do I need to do a rest before hitting run or debug from within Eclipse and reloading the application within my emulator?
I have occasionally received that error despite having plenty of room. You can first check to see if you are short on space (in the emulator from home screen: Menu -> Settings -> SD card & phone storage). Internal phone storage is the most important value, and you'll want to uninstall apps if that is low. If your app is set to install to the SD card, make sure that has enough room too.
If you have plenty of room, sometimes you can just retry the install and it will work. It can also help to uninstall the app from the emulator and then install it again. If those solutions don't work, you can restart the emulator. If all else fails, try creating a new AVD.