bug#81211: #81211 31.0.90; Android build fails with current Java compilers

Peter Oliver <[email protected]> Fri, 31 Jul 2026 01:27:40 +0100 (BST)
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On Thu, 30 Jul 2026, Johan Myréen wrote:

> Anyway, the outcome of the linker invocation
> above results in a huge binary file consisting mostly of null bytes. The
> size of the file is 137436859800 bytes, which happens to be a little less
> than 0x200000000. Likewise the file libloader.so, which is included in the
> Android Emacs installer file is 137 GB in size; examining an older emacs.apk
> file reveals that the correct size is about 7.3 kB.

This sounds like it probably has the same cause as an issue I ran into.  I see that I noted at https://gitlab.com/fdroid/fdroiddata/-/blob/923099b449b43fc3dbcffa68a42ee0f05b750528/metadata/org.gnu.emacs.yml#L1407:

>   To upgrade the NDK beyond version r28c, we will need at least
>   build-tools 36.1.0 on the buildserver, else we get the following error
>   from apksigner:
>
>     Exception in thread "main" com.android.apksig.apk.ApkFormatException: Malformed ZIP entry: lib/arm64-v8a/libloader.so
>     	at com.android.apksig.ApkSigner.fulfillInspectInputJarEntryRequest(ApkSigner.java:737)
>     	at com.android.apksig.ApkSigner.sign(ApkSigner.java:446)
>     	at com.android.apksig.ApkSigner.sign(ApkSigner.java:237)
>     	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:424)
>     	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:94)
>     Caused by: com.android.apksig.zip.ZipFormatException: Unexpected size of uncompressed data of lib/arm64-v8a/libloader.so. Expected: 4294967295 bytes, actual: 137436859792 bytes
>     	at com.android.apksig.internal.zip.LocalFileRecord.outputUncompressedData(LocalFileRecord.java:387)
>     	at com.android.apksig.ApkSigner.fulfillInspectInputJarEntryRequest(ApkSigner.java:735)
>     	... 4 more

So, I suggest trying with a later build-tools or an earlier NDK.

-- 
Peter Oliver