What is the difference between armeabi-v7a, arm64-v8a, x86?

AndroidPythonKivy

Android Problem Overview


I am working on an Android App on Kivy. I am using Buildozer to compile an APK file. In the Buildozer spec file, there's a setting android.arch = armeabi-v7a, I didn't understand this.

Also, when I generated the APK file using the command buildozer -v android debug and installed it using the command adb install bin/<appname>.apk - it didn't Open on my Android Phone.

Android Solutions


Solution 1 - Android

These are CPU instruction sets. Mostly you don't have to worry about it, the default is fine, but I've been meaning to add something to the docs about it due to some recent changes.

Basically, a given Android device might have an arm or an x86 cpu (or even something else but that's not important), these are just different architecture types from different manufacturers. Arm cpus are most common, but x86 is not unusual. When you compile code, the output depends on the architecture target. When you build a Kivy app, you specify one of the architectures and then the app will only work on that type of the device. If you want to support all devices, you can compile multiple APKs to distribute - the Play store will let you upload more than one, and will send each device the right one.

Within a given architecture type there are multiple versions. armeabi-v7a is the older target, for 32 bit arm cpus, almost all arm devices support this target. arm64-v8a is the more recent 64 bit target (similar to the 32-bit -> 64 bit transition in desktop computers). I think most new devices are 64 bit, but not sure. arm64-v8a devices can run code compiled against armeabi-v7a, it's backwards compatible.

As of later this year, the Play store will require you to upload an arm64-v8a APK as the minimum, because this gives the best support for newer devices. You will also be able to upload other APKs to support other device types.

That isn't quite the full story: some x86 devices have a special library that lets them run code compiled for arm devices. I'm not sure how widespread this is, but it seems pretty common.

For your app issue, use adb logcat to see what's wrong.

Solution 2 - Android

To be clear, these are not instruction sets. They are ABIs, which compile into instruction sets. Most devices today are arm64-v8a, the really cheap devices are armeabi-v7a to save cost, and almost none are x86 or x86_64.

e.g. The armeabi-v7a ABI compiles to armeabi, thumb-2 and VFPv3-D16 instruction set, but arm64-v8a ABI compiles to AArch64 instruction set.

Supported ABIs table 1 from https://developer.android.com/ndk/guides/abis

> Each combination of CPU and instruction set has its own Application > Binary Interface (ABI). An ABI includes the following information: > > The CPU instruction set (and extensions) that can be used. The > endianness of memory stores and loads at runtime. Android is always > little-endian. Conventions for passing data between applications and > the system, including alignment constraints, and how the system uses > the stack and registers when it calls functions. The format of > executable binaries, such as programs and shared libraries, and the > types of content they support. Android always uses ELF. For more > information, see ELF System V Application Binary Interface. How C++ > names are mangled. For more information, see Generic/Itanium C++ ABI. source

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionChitkaran SinghView Question on Stackoverflow
Solution 1 - AndroidinclementView Answer on Stackoverflow
Solution 2 - AndroidBen ButterworthView Answer on Stackoverflow