If an aar contains .so files for multiple architectures (e.g. foo and bar), and an android_binary depends on this aar, --fat_apk_cpu=foo,bar
doesn't pack both so files into the final APK correctly.
The current behavior only packs the .so for one target configuration into the APK.
In preparing for the new 64 bit support requirment incoming for August 1st https://developer.android.com/distribute/best-practices/develop/64-bit
I have come across this issue as well. Is there a recommended workaround? Right now our best option seems to be to generate both versions separately, merge them and sign the resulting APK.
Hi, my team has also found this issue. Is there any plan to address this soon/before the August 1st cut off?
Bumping this up due to the hard requirement on apps depending on multi-arch splits over 32 and 64 bit native libs.
WIP fix: https://github.com/bazelbuild/bazel/pull/8510
Using https://github.com/jin/repro/tree/master/8283 as repro:
$ bazel-dev build --fat_apk_cpu=armeabi-v7a,x86 :app && zipinfo bazel-bin/app.apk
INFO: Analyzed target //:app (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //:app up-to-date:
bazel-bin/app_deploy.jar
bazel-bin/app_unsigned.apk
bazel-bin/app.apk
INFO: Elapsed time: 0.222s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
Archive: bazel-bin/app.apk
Zip file size: 475815 bytes, number of entries: 10
-rw---- 2.0 fat 9 b- stor 10-Jan-01 00:00 nativedeps
-rw---- 2.0 fat 21792 b- defN 10-Jan-01 00:00 lib/armeabi-v7a/libapp.so
-rw---- 2.0 fat 6424 b- defN 10-Jan-01 00:00 lib/x86/libapp.so
-rw---- 2.0 fat 920 bl defN 10-Jan-01 00:00 classes.dex
-rw-rw-rw- 2.3 unx 1168 b- defX 10-Jan-01 00:00 AndroidManifest.xml
?rw------- 2.0 unx 184888 b- stor 10-Jan-01 00:00 lib/armeabi-v7a/libenvoy_aar_jni.so
?rw------- 2.0 unx 268104 b- stor 10-Jan-01 00:00 lib/x86/libenvoy_aar_jni.so
-rw---- 2.0 fat 648 b- defN 10-Jan-01 00:00 META-INF/CERT.SF
-rw---- 2.0 fat 1203 b- defN 10-Jan-01 00:00 META-INF/CERT.RSA
-rw---- 2.0 fat 563 b- defN 10-Jan-01 00:00 META-INF/MANIFEST.MF
The fix will be in 0.27.
Thanks @jin!
Most helpful comment
The fix will be in 0.27.