0

I have M1Max Apple Macbook Pro (Apple Silicon chip).

Trying to run Android apps on emulator in Android Studio.

I tried the following emulators:

  • Pixel 5 API 32, Android API 32 arm64 (this launches but can't run app)

  • Pixel 3a API 32 arm 64 (launches but can't run app)

  • Pixel XL API 30, Android 11.0, x86 (this won't even launch)

When I try to run app in any of them I get the following error:

[CXX1405] error when building with ndkBuild using xxxxxx/Android.mk: Build command failed.
Error while executing process /xxxxxx/ndk-build with arguments {NDK_PROJECT_PATH=null 
APP_BUILD_SCRIPT=/Users/xxxxx/Android.mk
NDK_APPLICATION_MK=/Users/xxxxx/Application.mk APP_ABI=arm64-v8a 
NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1
APP_PLATFORM=android-16 NDK_OUT=/xxxxx/obj
NDK_LIBS_OUT=/xxxxx/lib
APP_CFLAGS+=-DLITE_VERSION=1 APP_CFLAGS+=-DDEBUG=1 
NDK_DEBUG:=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
ERROR: Unknown host CPU architecture: arm64

It seems it boils down to this problem: ERROR: Unknown host CPU architecture: arm64

What solution should I see to be able to run this on Apple silicon?

Thank you

AndyTTT
  • 1
  • 1
  • Does this answer your question? [Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro](https://stackoverflow.com/questions/69541831/unknown-host-cpu-architecture-arm64-android-ndk-siliconm1-apple-macbook-pro) – James Greenhalgh Jul 30 '22 at 11:20

1 Answers1

0

I believe this error does not have anything with the emulator and your M1 arm processor. You need to define NDK path in your project.

NDK_PROJECT_PATH=null 

Install NDK from SDK manager and check if the project runs.

mmBs
  • 8,421
  • 6
  • 38
  • 46
  • Thank you for your reply. Unfortunately, it doesn't seem to solve the issue. I installed all NDK's and am still getting the same error. – AndyTTT Jul 28 '22 at 13:42
  • Did you update all the paths where your NDK is installed? – mmBs Aug 01 '22 at 08:24