Build - Android - APP ABI?

Hi @slackmoehrle, @pandamicro

I’m trying to test my anrdoid .apk using default template api level 10, however, which app abi for cross platform? Should I leave these 4 choices 1) armeabi, 2) armeabi-v7a, 3) arm64-v8a, 4) x86 unchecked for cross platform doesn’t matter which device? Or do i have to choose 1 of the 4 for general compatible across different platforms, if so which one? Thanks and God Bless…

Sincerely,

Sunday

1 Like

armeabi most universall
for newest device u could include armeabi-v7a

others are not that much popular so you can ignore them for now:D

Hi @energyy

Thanks for the guidance and help…:slight_smile: So, in other words, I could also include all of them, but then again, it would increase my export apk…… ? Thanks again…God Bless…

Sincerely,

Sunday

If u planning to publish on google play there is option to generate separate apk for each abi and upload all of them under same app.

Hello @energyy,
Can you please guide/explain more on uploading separate apk for each abi in Google Play Store ? May be with screenshots :slight_smile: .

1 Like

Hi,

check there https://developer.android.com/google/play/publishing/multiple-apks.html

For example u targeting ARMEABi, ARMEABI-v7a, x86 Android devices.

Compile 3 APKS with different build versions:

  1. ARMEABI(v1 build 1)
  2. ARMEABI-v7a (v1 build 2)
  3. X86 (v1 build 3)

And upload them in order from most popular abi with lowest version to not that popular abi with higher version - in this case you should have 3 active APK in google developer console. Google play then will decide based on user device which APK to install.

This is my solution for that (app/build.gradle):

apply plugin: 'com.android.application'

import com.android.build.OutputFile

android {
    def abiCodes = ['armeabi':1, 'armeabi-v7a':2, 'arm64-v8a':3, 'mips':5, 'mips64':6, 'x86':8, 'x86_64':9].withDefault {0}
    ...
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'arm64-v8a', 'armeabi-v7a', 'armeabi'
            universalApk true
        }
    }

    applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.versionCodeOverride =
                abiCodes.get(output.getFilter(OutputFile.ABI)) * 100000000 + android.defaultConfig.versionCode
        }
    }
}

This way my versionCode is always correct and I can upload them, as @energyy described. The 100000000 is so big, because of my calculated versionCode (versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild), but I also found other possible ways to generate them, see for example here.

@energyy Do you have any other ideas for that?

1 Like

yeah, that is one of the best solutions. We right now do this manually when needed - due to long compile if compiling all ABI’s for tests.

I automate as much as possible, because I’m a developer and we are lazy by definition :wink: