Android 9.+ emulator does not start

2019-08-25 11:33发布

问题:

All AVD images work on my machine except for Android 9.+ (Google Play) & Android 9.+ (Google APIs) (the Android Studio emulator for Android Q beta).
I just downloaded the most recent images. From android-Q/google_apis_playstore/x86/build.prop:

ro.system.build.version.incremental=5506116
ro.system.build.version.release=10
ro.system.build.version.sdk=28

I am using Android Emulator version 29.0.11.

However, when I start these up, I see the device frame with a black screen. I get no error message, just nothing. It stays like this indefinitely.

Is there any way to debug this or is this a common issue?

Update: on another device (same image), I got the following screen instead of a black screen, however, there is still nothing I can do:

回答1:

You need to configure correctly the Hardware Acceleration for your Emulator. Please, follow these steps:

1) Install the Intel HAXM driver if you are on Windows and have Intel, follow these steps:

  • Open the SDK Manager.
  • Click the SDK Update Sites tab and then select Intel HAXM.
  • Click OK.
  • After the download finishes, run the installer. Typically, you can find the installer in the following location: sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
  • Use the wizard to complete the installation.
  • After installing Intel HAXM, confirm that the virtualization driver is operating correctly by entering the following command in a Command Prompt window:
    sc query intelhaxm

You should see a status message that includes the following information:

SERVICE_NAME: intelhaxm
       ...
       STATE              : 4  RUNNING
       ...

For Linux, check this link

For Mac, check this link

2) Open AVD Manager on Android Studio:

  • Edit the Virtual Device where you set target Android Q
  • Click Show Advanced Settings.
  • Set Graphics to Automatic or Hardware.


回答2:

I fixed it by reinstalling Android Studio entirely.
Actually, I just wanted to reinstall the Android SDK, however, you seem to need to install a stable version of Android Studio for that. After that, I set everything up the same way again and ran the beta version and now it works.



回答3:

In my case all other emulators started, except Q. I have all needed SDK and AVDs.

But every time emulator didn't start without any error.

I saw Emulator in Android Studio doesn't start and found a way to understand a reason. I started from avd path:

D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none

and got an error: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [D:\Android]!. In PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value I found that we should read config.ini inside 'Pixel_2_API_29.avd' folder and detect the line

image.sysdir.1=system-images\android-29\google_apis_playstore\x86\

I understood that I missed android-29 image in SDK path!

I knew that moved SDK and AVD folders from C:... to D:\Android, but SDK was kept in two folders.

And I forgot to change one system variable (ANDROID_HOME):

So I changed it to D:\Android and restarted the PC.

After restarting I deleted old SDK folder (in 'AppData\Local\Android'). Then I started again:

D:\Android\emulator\emulator.exe -avd Pixel_2_API_29 -netspeed full -netdelay none