Which Android Virtual Device should be used to launch arm64-v8a APK on Windows?

Viewed 10718

I have a common APK app that utilizes 'arm64-v8a' 'armeabi-v7a' ABIs. How should I tune an Android Virtual Device to be able to launch this app?

I tried different combinations but it still does not work.

A bit of details

Environment

  • Windows 10, CPU Intel Core i5-10300H, RAM 16GB, a lot of free space on a SSD;
  • Android Studio Arctic Fox | 2020.3.1 Patch 3;
  • Intel x86 Emulator Accelerator (HAXM installer) v.7.6.5 is installed;
  • Android SDKs 12.0, 11.0 and 10.0 are installed;
  • Numerous different virtual devices are installed (see the pictures below).

Images that were applied

  • Apply different system images mainly with API from 26 to 31;
  • Images were used from different tabs in the AVD manager (Recommended, x86 and Other Images);
  • Images with ABI both x86, and x86_64, and arm64-v8a;
  • Images with/without Google API, with/without Playstore support.

Errors that I've got

  • Some emulators do not launch. The console says: PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host.
  • The APK was not installed on some emulators, a popup with message appears: INSTALL_FAILED_NO_MATCHING_ABI
  • The app tries to start (a splashscreen is shown) but suddenly closes. I've noticed that logcat outputs such message (perhaps related to the app): Unexpected CPU variant for X86 using defaults: x86_64

Some pictures in addition enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

2 Answers

I hit this exact same issue. The comment from @WGH is spot on! Look at the line of code that is failing.

#ifdef __x86_64__
      if (sarch == "arm64" && apiLevel >=28) {
          APANIC("Avd's CPU Architecture '%s' is not supported by the QEMU2 emulator on x86_64 host.\n", avdarch);
      }
#endif

(Source : here)

I deleted my arm64 AVD based on apiLevel 32 and used an older apiLevel of 25 from Nougat 7.1.1 and it loaded up the arm64 AVD just fine on QEMU, ubuntu 20.04. (albeit slowly!!)

The comment from @mtotschnig is also probably relevant however the app I was testing wouldn't run on the api version 30 with the x86_64 AVD that I was attempting to use.

Ok, the issue is solved. I do not know the root of the cause, but I just:

  • drop all virtual devices,
  • drop whole Android studio,
  • download the studios's installation package again,
  • install Android studio once more,
  • add a known virtual device: Nexus 5X with Play Store, image ABI x86 API 30 with Google Play support.

That's it. The app's been launched.

Related