Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get device density & install apks to arm64_v8a emulator running on Apple Sillicon M1 #240

Closed
fadeltd opened this issue Sep 8, 2021 · 2 comments

Comments

@fadeltd
Copy link

fadeltd commented Sep 8, 2021

Describe the bug
As the title described, I've just got Apple Sillicon M1 machine for development, and as usual, I install latest android studio: arctic fox, and also install the emulator. As Intel x86 emulator don't work on my machine, I tried arm64 emulator, it works when I install apk to the emulator and click run from android studio, but I can't install aab & apks with bundletool as usual, because bundletool can't seem to get the emulator device density.

I use system-images;android-31;google_apis;arm64-v8a system image.

even get-device-spec command won't work, so I can't install apks with --local-testing

Bundletool version(s) affected
Version: 1.8.0

Stacktrace

[BT:1.8.0] Error: Error retrieving device density. Please try again.
java.lang.IllegalStateException: Error retrieving device density. Please try again.
	at com.google.common.base.Preconditions.checkState(Preconditions.java:508)
	at com.android.tools.build.bundletool.device.DeviceAnalyzer.getDeviceSpec(DeviceAnalyzer.java:60)
	at com.android.tools.build.bundletool.commands.GetDeviceSpecCommand.execute(GetDeviceSpecCommand.java:162)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:86)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:49)

To Reproduce
Well clearly, --install-apks doesn't work, but to reproduce it easier, get-device-spec also doesn't work, so I don't need to provide my aab, it seems like adb/emulator issue.

java -jar bundletool-all-1.8.0.jar get-device-spec --output=outputs/device-spec.json 

Expected behavior
I can install normally like on my intel mac with x86 emulator

Known workaround
I haven't been able to install my aab unless I build and use universal apk

Environment:
OS: macOS Big Sur 11.2.3 (M1 2020)

@sleekweasel
Copy link

Looks related to #241

Android 12 lacks the qemu device density property.

@fadeltd
Copy link
Author

fadeltd commented Sep 15, 2021

Looks related to #241

Android 12 lacks the qemu device density property.

I've confirmed this, it works on Android Q 29 & R 30 arm64-v84 (Both google apis)

system-images;android-30;google_apis;arm64-v8a
system-images;android-29;google_apis;arm64-v8a

This is related to the Android API 31 instead of the emulator with specific abi
I'm closing this in favor of #241

@fadeltd fadeltd closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants