bisthebis
bisthebis

Reputation: 523

Qt creator : create an APK compatible with multiple ABIs?

When building a Qt application on android, you have to choose whether you want to use ARM abi or x86 abi. Is it possible to create an APK compatible with both ABIs, and how ?

If I'm correct, the APK built by Qt Creator has a subfolder libs/ containing all the shared libraries required by the JNI. Depending on what you build, libs/ contains either "armeabi-v7a" or "x86" subfolder with the correct files. How can I have an APK containing both subfolders, such that all Android devices can run the APK ? I tried by modifiying the APK myself (since it's a plain .zip), but it messed up signatures etc.

Or am I doomed to publish to Google Play with two APKs ?

Upvotes: 3

Views: 735

Answers (1)

AD1170
AD1170

Reputation: 418

I have found a solution that work (at lest for me).

  • Build the APKs (e.g.armeabi-v7a and arm64-v8a) separate. Sign the APKs in the Buil APK Step in QtCreator in order to build a release - APK (w/o debug server).
  • Use ZIP tool (e.g. 7zip) to open the unsigned arm-v7a release APK and copy the "/lib/armeabi-v7a" folder to the unsigned arm64-v8a release APK (the unsigned APK is created by QTC before signing).
  • Run zipalign 4 on the combined apk and sign the aligned APK with apksigner.
  • Done

The whole process can be programmed in a cmd or bat file.

Upvotes: 3

Related Questions