Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HelloAndroid emulator problem

I''m trying android SDK for the first time. I'm starting with the HelloAndroid tutorial. followed exactly each step but the emulator launches without my app. eclipse console says:

[2010-02-23 11:47:55 - HelloAndroid]------------------------------
[2010-02-23 11:47:55 - HelloAndroid]Android Launch!
[2010-02-23 11:47:55 - HelloAndroid]adb is running normally.
[2010-02-23 11:47:55 - HelloAndroid]Performing com.example.helloandroid.HelloAndroid activity launch
[2010-02-23 11:47:55 - HelloAndroid]Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
[2010-02-23 11:47:55 - HelloAndroid]Launching a new emulator with Virtual Device 'my_avd' [2010-02-23 11:48:09 - HelloAndroid]New emulator found: emulator-5554
[2010-02-23 11:48:09 - HelloAndroid]Waiting for HOME ('android.process.acore') to be launched...

I see the emulator, the ''Android'' text on it but nothing else happens. can someone help please? thanks!

like image 916
oriharel Avatar asked Feb 23 '10 10:02

oriharel


People also ask

Why is my Android Emulator not working?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.

How do I fix an emulator problem?

If the emulator fails to launch due to the error vulkan-1. dll cannot be found , you probably need to update the emulator. To update the emulator in Android Studio, go to Tools > SDK Manager and install the latest stable version of Android platform.

Why is my emulator stuck?

From Android Studio, select “Tools” > “Android” > AVD Manager. Right-click the emulator you are using, then choose “Stop“. Try running the emulator again.


1 Answers

Summary
(You can see the full details below these summarized steps).

  1. Uninstall/Reinstall Android SDK to folder off of C:\ (no spaces in path)
  2. Re-create the AVD.
  3. Set the PATH environment variable for the new Android SDK folder locations
  4. Uninstall/reinstall the Android ADT Plugin in Eclipse.
  5. Configure the Android SDK location in Eclipse.
  6. Reboot (to reduce the CPU utilization)
  7. Run the emulator from the command line and set it to use all CPUs with High or "Real Time" priority. Make note of your CPU usage.
  8. Open Eclipse and run the app.

Details
I spent two days getting the emulator to run the HelloAndroid app. In my case the problem might have been a combination of an issue with the Android SDK installation and a CPU performance problem. I think something was causing the emulator to run extremely slowly making the emulator appear to hang. My PC is a my Windows 7 64-bit 6GB Intel i7 multi-core PC. Task Manager shows 8 CPUs on my PC on the Performance tag.

My symptom was the Android 2.2 AVD in the emulator appeared to hang when the nimated "Android" text was showing on the screen. The Home screen would never show up. This scenario happened over and over. I would often wait 30 minutes or 45 minutes to no avail.

My environment:

  • Android SDK Revision 12
  • Android 2.2 AVD
  • Windows 7 64-bit
  • Eclipse IDE for Java Developers Indigo Release Build id 20110615-0604
  • Intel Core i7 multi-core CPU, 6 GB, 1.6 GHz

I tried starting the emulator from the command line without starting Eclipse at the command prompt and that didn't help. The emulator still hung. I noticed that Task Manager showed my box at 50% CPU usage which seemed rather high. CPU 0 was pegged at 100%.

Here's what fixed it.

I uninstalled the Android SDK R12 and reinstalled it off the root of C: at C:\android-sdk. I had previously experienced problems because the Android SDK was located at "C:\Program Files" folder; the SDK has a bug that can't handle the space in the path. I ran "uninstall.exe" from the Android SDK folder to do the uninstall. Uninstalling took longer than installing.

I added ";C:\android-sdk\tools\;C:\android-sdk\platform-tools\" to the PATH environment variable.

I then deleted the AVD using SDK Manager and recreated it.

I uninstalled the ADT Plugin for Eclipse, restarted Eclipse, then reinstalled the ADT Plugin, then closed Eclipse.

I reconfigured Eclipse with the new Android SDK path (Window > Preferences > Android > SDK Location).

On the Task Manager Processes tab, I enabled "Show processes from all users". I then right clicked "emulator-arm.exe *32", then clicked "Set Affinity..." and noticed that the emulator was set to only use CPU 0 so I changed it to use all CPUs. I also set the emulator to "Real Time" priority.

Observing a 50% CPU Usage, I rebooted.

After rebooting, I started the emulator using the command line:

emulator @Android22

Android22 is the name of my AVD. I used task manager to set the affinity for the emulator to use all CPUs and set the priority to high. My CPU usage was now about 13%, mostly due to the emulator. The emulator took about 3 minutes to show the Home screen. Yay!

I then opened Eclipse with the HelloAndroid app and the app successfully ran in the emulator.

I have written out in detail what I did because the past two days have been a real pain. I noticed several posts about this issue with many people not seeming to have success. I performed steps mentioned in several posts but did not find one place that described the whole process.

Good luck. I hope this info helps someone.

like image 117
walkerk Avatar answered Oct 07 '22 23:10

walkerk