Development issue/problem:

I have a number of native libraries that are quite large and blow up the binary size of the application. I have considered splitting up KPAs, but preserving and guaranteeing the quality of different KPAs is not something I want to do.

That’s why I want to exclude unused architectures from my construction version by using the property Gradle ndk.abiFilters. (The debugging is built up that I want to leave alone so I can run the emulator with HAXM acceleration on x86).

I’ve thought about having only armabi-v7a and arm64-v8a in my range, but I’m not sure I should worry about the market share of other architectures I’m dropping. After a long search I can’t find any reference to ARMv6 (armeabi), MIPS, x86 or x86_64 market share. My hunch is that the last three almost don’t exist, but I’m not sure about the ARMv6.

I found this link on a forum that has a list of phones with different architectures. Is there anything more reliable than that? Perhaps with the % of users similar to the dashboard version of Android?

Is there anything else I could do without if I only built my own libraries for poorabi-v7a and arm64-v8a (or poorabi, poorabi-v7a and arm64-v8a)?

How can I solve this problem?

Solution 1:

First of all, if you are worried about the size of the binaries, you don’t really need arm64-v8a, all these devices can run armabi-v7a binaries very well. Only if you really need that last extra performance can it be useful.

As for poorabi and ARMv6, Android itself hasn’t officially supported it since Android 4.4 (October 2013) – and with Android 4.0 it should be much less common (as of this version, the sources of the AOSP require changes to build for ARMv6). So, in practice, if you do not support versions lower than 4.4, you can dispense with this version without significant loss.

Also for x86; many of these devices come with a surprisingly decent weapon binary emulation, so those who can handle the poorabi-v7a version are also fine.

Solution 2:

The inclusion of additional architectures no longer affects the size of the binaries when using application packages, because Google Play then delivers only the binaries associated with that device to each device. Moreover, the application updates will be much smaller and faster.

Leave the above information for projects that do not yet use apple sets:

  • Unfortunately, as useful as Android Dashboard is, it doesn’t offer architecture information and Google Analytics either.
  • The unit statistics are used to provide statistics on the architecture and characteristics of the processor. Note, however, that these are not general statistics, but only for users of Unity applications and games. It seems that the public link information is no longer available, so I replaced the direct links with the latest snapshots from archive.org.

Solution 3:

I got stuck with this problem using Mapbox and found this article that helped me a lot.

According to the picture below you only need poorabi-v7a and x86. I then added the armeabi-v7a based on José Gomez’s answer and had no problem.

So add this line to your App.gradle.

android {
defaultConfig {
//other configurations
ndk {
abiFilters armabi-v7a
}
}
}

If you’re still worried about the 2-3% that use x86 architecture, such as B. ASUS ZenFone and Lenovo phones, use this configuration in app.gradle.

ndk {
abiFilters armeabi-v7a, x86
}

For genymotion emulators, you should also use the x86 architecture.

Give here a description of the image

FIXED

If you get this error when publishing an apk to the game shop.

Give here a description of the image

Then use this.

ndk {
abiFilter armeabi-v7a, arm64-v8a
}

Finally, I suggest you use the apple package to free the KPA.

Solution 4:

When I read @mstorsjo’s answer, I was a bit confused to see that you can actually only use one (or two) native libraries, even though it’s quite simple and straightforward. I will therefore give an example here and give some additional explanations (based on my further research).

For each supported architecture, we need to create a specific directory in the jniLibs directory and put the .so file in it. For example to support the armabi-v7a (32bit) and arm64-v8a (64bit):

|–app
|—-src
|— head
|— jniLibs
|–|——armeabi-v7a
|–|———.so files
|–|——arm64-v8a
|—–||||——-.so files

With poorabi-v7a you support more than 90% of the available devices, but because it is a 32-bit architecture, running on 64-bit devices results in a performance loss (20-30%) {1}. On a case-by-case basis, it can be very useful to check the actual number of supported devices, which can be done in the Google Game Console under Problem Management > Device Catalog, mentioning ABI as the filter.

Attention

If you are not adding binaries for all architectures, consider the following:

If your application contains other native libraries, make sure you only use the same versions. Indeed, Android requires that all loaded native libraries are built for the same architecture. For example, if the first native library to be loaded is armabi-v7a, Android will ONLY look for armabi-v7a libraries in all subsequent calls from System.loadLibrary(). If it does not find this exact architecture, it throws a java.lang.UnsatisfiedLinkError exception. {1}

I came across this problem because some of my addictions used indigenous libraries, which stopped the loading of poorabi-v7a.

Good luck!

arm64-v8a,armeabi-v7a 32 or 64 bit,android emulator arm64-v8a,android aarch64,android ndk cpufeatures,android studio neon support not enabled,android architecture pdf,android architecture components,android architecture components import,android adding architecture components,android ui components,livedata lifecycle-aware,arm64-v8a android devices,arm v8a 64 bit android,arm v8a 64-bit samsung,arm v8a 64-bit vs snapdragon,arm v8a 64 bit vs snapdragon 665,arm v8a 64-bit device wikipedia,mvvm android example,android jetpack components,android architecture diagram,android clean architecture,mvp architecture android,android hal implementation example,android treble architecture,project treble devices 2020,aosp audio,android app is developed in,a/b update in android tv is also known as,galaxy s7 architecture arm,armeabi-v7a,arm64 vs x64,nokia 6.1 arm64,s10 plus arm64,droid hardware info apk,aarch64 processor rev 4 vs snapdragon,armeabi-v7a devices,ndk ( abifilters armeabi-v7a','arm64-v8a','x86','x86_64 not working),android devices by architecture,android arm64,armeabi vs armeabi-v7a,android supported architectures,x86 android devices 2019