using APK Signature Scheme v2: integer overflow when installing APK to Quest

I am working on a PCVR to Quest port and have issues installing the game. The build goes well, but I get this error.
I tried a blank project with the same setup and that did install properly.

Full error: A task failed. Check the tasks screen for more info. 1.6a 2020.apk: : /data/local/tmp/_stream.apk could not be installed [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl1614583577.tmp/base.apk using APK Signature Scheme v2: integer overflow]

Setup:
Quest 2
Unity 2020.3.23f1
Oculus XR 2.0.0 preview (same issue with 1.11)
XR management 4.2.0
Android minimal v set to v23 (so both v1 and v2 signing is applied)
IL2CPP backend
Q1 and Q2 both checked in Oculus settings
Same keystore used as my sample project which did work
Issue both when building with OVRBuilder and regular building

If you need more info please ask

Did you ever solve this? I’m having a similar problem. It seems related to the size of the apk.

Oh, looks like there’s a 2GB limit for apk’s now… Android .apk install fail - Failed to collect certificates - Lemma Soft Forums

1 Like

I reimported my project and it was somehow fixed

Thanks for this! I spent two days trying to figure out what was causing my builds to fail and it turned out that I had some unused files in the Streaming Assets directory that were putting my builds over 2GB limit. It would be great if there was a file size check on builds so a relevant error message could be thrown.

2 Likes

You could program that in yourself (I might do it with a tool), but the sizes are different for all distributing platforms, so it’s not Unity’s task to check build sizes

I agree Error messages in just about every app miss these sorts of more descriptive errors. I hope AI will add this layer as it will save us all a lot of time.

My solution was to drop the APG (Android Plugins For Gradle) version to 3.6.0. In practice, I found that going up to 4.2.0 was fine. When I had the same problem, my APG was 4.0.1. The META-INF.MF display in apk is Generated By ADT, more than 2G close to 3G. When I set it to Develoment Build, the display is generated by Signflinger.

Apks signed with Signflinger package smoothly.

So maybe try change the APG version

For me I had to use the correct android manifest (generated it using oculus integration in a seperate project)