youchenlee
youchenlee

Reputation: 51

gradle "universalApk true" doesn't build me an apk with all the mentioned ABIs

I'm using android studio 2.1.2 and gradle 2.12, with the following gradle.build script:

splits {
    abi {
        enable true
        reset()
        include 'x86', 'x86_64', 'armeabi-v7a'
        universalApk true
    }
}

After the build, it generates the following APKs.

However, it seems the project-universal-*.apk doesn't contain the x86 and x86_64 support I want. It was not able to install on my x86_64 emulator. (which the project-x86_64-debug.apk works well)

$ adb install project-universal-debug.apk
[100%] /data/local/tmp/project-universal-debug.apk
    pkg: /data/local/tmp/project-universal-debug.apk
Failure [INSTALL_FAILED_NO_MATCHING_ABIS]

And I also check it by the aapt command: (not sure it's the right way)

$aapt dump badging project-universal-debug.apk  | grep native-code
native-code: 'armeabi' 'armeabi-v7a'

What can I do the have the universal APK for all the ABIs from include 'x86', 'x86_64', 'armeabi-v7a'?

Upvotes: 2

Views: 3530

Answers (1)

Murilo Perrone
Murilo Perrone

Reputation: 504

Have you tried using the complete list of abis? This worked for me:

include 'arm', 'arm-v7a', 'arm64', 'mips', 'x86', 'x86_64', 'armeabi-v7a'

Upvotes: 0

Related Questions