Android Virtual Device gets hosed somehow - android

I am going through the Android tutorials and at some point an app won't load. The last message on the console is "Installing RelativeLayout.apk..." and it just stays there forever, instead of going on to the "Success" message. Visually, what is happening on the emulator is that it starts with the "A N D R O I D" phase, goes on to the chrome "android" phase, goes on to the home page, and then the little animating battery icon stops moving. After that we go back to the chrome "android" and just stay there forever. Quitting the emulator and rerunning the app doesn't help.
Looking at the log, using the adb tool with logcat, at one point the log lists service after service that died. This occurs right after this log message:
D/Zygote ( 32): Process 59 terminated by signal (11)
When I run adb logcat and have the emulator window visible at the same time, I can see that the battery icon stops animating just about when this message appears. No idea what this means.
I can fix the problem by going to Window --> Android SDK and AVD Manager which has a list of the AVD's if you click on "Virtual Devices" on the left. What I discovered to work is to quit the emulator, then in this window to select the AVD I'm trying to use, click "Start..." on the right, then in the Launch Options box that comes up, check Wipe user data, then hit Launch. The emulator will run until the home page shows up, then I can run my tutorial just fine.
What's causing the problem? What am I doing wrong? I blogged about this in my Into Apps blog and I'd like to be able to post the solution to the mystery as well.

What is your app doing? specifically, are you doing any CPU intensive work that could be stalling out the emulator? If you are, it could be you have a service that doesn't shut down properly, or a run away thread.
If not, i would say just uninstall your SDK and everything to do with the emulator and reinstall a fresh copy. Could just be that there is something screwy with your integration.

Related

Emulator freezing at startup

With the boot option set to "quick boot", when I try to launch an Android emulator, the emulator window pops up but the screen remains black with an information message at the top saying : "Cold boot : snapshot doesn't exist". A "dismiss" button is at the right of this text.
With the "cold boot" option, no message is displayed but the screen remains desesperatly black as well.
Even if I close the window, the qemu process remains alive. I have to kill it and remove the ".lock" files to be able to retry launching the emulator.
Additionnaly, my computer informs me that the graphics driver (AMD) was not responding anymore and had to be restarted.
Any idea about the source of the problem?
I had an emulator frozen with application screen. No buttons worked. Screen didn't respond at all. This helped in my case:
AVD Manager -> Arrow down in action section of preferred emulator -> Wipe Data
A workaround is to start it from command line using -no-snapshot argument. Similar to wiping the data out, just less work.
Doing that it will go into Cold Boot and it will work - similar to what #JohnnyFive suggested, but a bit less work.
Despite a driver supposed to be up-to-date (that's what Windows used to tell me...), after installing the latest software from AMD (Crimson relive 17.7.1), the emulator now successfully works.
In my case, the emulator freezes every time startup if not cold boot.
I dig into it and finally find the reason.
I find that the SD card simulating function is relevant to this situation. If "No SDCard" is set, the emulator freezes at startup 100%!! So I revert the SD Card settings to the default then... voĆ­la!
SD Card

How to stop emulated app from running? (Android Studio, 64-bit Win7 SP1)

Running Your App -> Run on the Emulator clearly explains how to RUN an app from within Android Studio by launching the emulator.
My question is -
Once I've done that: "How should I STOP the emulated app from running?"
Thought #1 - Use the "Run -> Stop (Ctrl + F2)" option on Android Studio's menu. But, when running my simple Hello-World-type application, that option is disabled.
Accordingly, Ctrl+F2 has no effect.
Thought #2 - Close the emulator window, by right-clicking the emulator's icon in my task bar, and selecting "Close window."
That closed the application all right, but then it seemed to leave things in a strange state.
-- When I tried to run the application again, it gave an error and I had to recreate the project.
That happened repeatably.
Thought #3 - Try shutting down the (emulated) Android device.
I tried that on Saturday evening: I held down the (emulated) Power button. Clicked the option in the "Device options" window.
It's now Monday morning, and it still says that it's "Shutting down...".
So, "How should I stop the emulated app from running?"
Thank you for any suggestions/help you can provide.
Russell
I now see that I had asked the wrong question.
I should have asked how to stop a running emulator.
Although I had been able to do so by right-clicking the emulator's entry in the task bar, and selecting "Close window", that had SEEMED to cause some problems.
["The selected device is incompatible" was displayed in the "Device Chooser" dialog.]
So, I thought that was the wrong way to do it.
Since then, though, I think I've figured out that something else was causing my problems:
I had an Android emulator process (emulator-arm.ese *32) which
hadn't terminated properly.
When I selected another device, I hadn't
given the (slow) Android emulator enough time to clear the "The
selected device is incompatible" error(s).
The problem process stayed in Windows' Task Manager after I shut down Android Studio, and Task Manager's failed to kill it.
So I rebooted my PC, and now everything seems to work OK.
Use the multitask button on the emulator itself to open the list of running apps, then click the "X" to close your app.

AVD Manager window blocks Eclipse window on Mac

I'm a complete newbie trying to learn how to write an app. I'm trying to run Hello World using the emulator in Eclipse on my Mac. I launch and unlock the emulator. Android Training then implies that I should click the Run icon in Eclipse. But the ADT Manager window is in front of the Eclipse window and Eclipse is disabled. If I minimize the ADT Manager window it just quits the ADT Manager, and then I must close the emulator window.
I did discover that I can run the app with the Run button without starting the emulator as a separate step, although that takes a long time to get going.
Another Answer implies that I can just rerun the app by clicking the run button again, but I can't do this because the Eclipse window is disabled.
I'm used to being able to use the IDE while a program (Yes, I'm an old programmer) is running. What am I missing?
Duncan
You're right - simply hitting run on the application cold turkey takes forever because the emulator has to initialize. When you click on your AVD Manager (where you can create, edit, and customize the android emulator you'd like to use), Select the emulator you'd like, then click Start.
After waiting for the emulator window to popup, just wait until the UI loads (when you can unlock the emulator).
At this point, it appears that the AVD Manager is still necessary (due to the "loading" type green bar along the bottom seemingly feeding the emulator), but you can just close the window, and the Eclipse window will become clickable again.
Now, you can just leave the emulator running. I typically leave it running for hours at a time (even overnight) and I can usually just click Run as Android Application and everything works perfectly.

Writing first Android app, stuck trying to simply run the Hello World tutorial

I'm new to Java, haven't used Eclipse in probably 2 years. We're starting up a mobile dev team at work, and I'm just going over the tutorials on the Android site:
http://developer.android.com/training/basics/firstapp/running-app.html
Simply just created a project, launched the virtual device manager, have that emulator running, then click Run -> Run as Android application in Eclipse .
I've been staring at this screen for about 5 minutes now:
It says "Launching (100%)" in the bottom right corner of eclipse, and this Progres window just says Launching, but the emulator isn't doing anything.
I know emulators are generally pretty slow... But is this normal or did I do something wrong?
That happened to me too, and still does at times:
Close the emulator and execute the program again
If that didn't work, execute the program while the emulator is running. A new emulator will pop up, close the old emulator
If that didn't work, delete device and create a new one.
Also, is there anything at all popping up on the Logcat view?
I would recommand checking the list of process afterwards. Sometimes when i brutally terminate an app in eclipse, the process is still running.
But i'm on PC and i use an older version. Maybe it has been fixed.

Virtual Android Machine doesn't load anymore

I have no idea what happened. I was using it normally just yesterday, today every time I turn on a VM, it keeps going on with the loading animation (upwards of 10 minutes). The VMs were never slow on my pc (Core i7). In under two minutes, it would completely load with all the applications installed. I don't have any errors because it either ends up crashing completely or the VM loads but is immensely slow` ,such that I would get messages similar to :
Virtual Machine has stopped responding.
EDIT: I tried turning it on again. After 30 minutes the VM loaded with a blank screen. Then when I tried to click on a button in the keypad, it went back to the loading screen.
EDIT: It turned on now but it is slower than anything I have ever experienced before. My AVM was NEVER this slow. I unlocked the phone and this message popped up: "Process system is not responding." I have two options "wait" or "ok". After I clicked Wait, I could interact a bit with it, but then a second message popped up "Unfortunately the launcher has stopped." and I'm back on the main screen.
I found the answer. I accidentally deactivated the high-performance mode on my laptop. I re-activated it and now it seems to be back to normal.

Categories

Resources