• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Header too long fatal exception

Hi Gamemakers!
I am a novice and there is tons that I don't understand yet. Run into a problem and I haven't found anything on the net on how to fix it.

I am trying to submit my app to Google Play store and I am getting consistent crash reports.

Code:
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c00007b:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG
     FATAL EXCEPTION: main
Process: yourfloria.com.Floria.game, PID: 12877
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c00007b:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG
    at com.google.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:121)
    at com.google.android.vending.licensing.LicenseChecker.<init>(LicenseChecker.java:92)
    at com.google.android.vending.expansion.downloader.impl.DownloaderService$LVLRunnable.run(DownloaderService.java:775)
    at android.os.Handler.handleCallback(Handler.java:789)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c00007b:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG
    at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:275)
    at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:54)
    at java.security.KeyFactory.generatePublic(KeyFactory.java:357)
    at com.google.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:112)
    ... 9 more
Caused by: java.lang.RuntimeException: error:0c00007b:ASN.1 encoding routines:OPENSSL_internal:HEADER_TOO_LONG
    at com.android.org.conscrypt.NativeCrypto.d2i_PUBKEY(Native Method)
    at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:273)
    ... 12 more
I use 2.2.5.481 version of GMS2.
I used VM compiler. When I try to use YYC compiler I get build failed "Too many open files" error.
Thank you so much in advance!
 

Yal

šŸ§ *penguin noises*
GMC Elder
"header too long" in this case probably refers to the header of the data going through OpenSSL, not a file header. This kind of stuff is pretty tricky... I remember an issue on my day job where roughly one in 1000 builds would silently fail because a bunch of random data got interpreted as an SSL header (with an illegal, really large "length" field which caused the program to loop forever when trying to parse it) by a naive security algorithm that would just try SSL first and then try other security methods if it failed; it never tried anything else in this case since it looped forever (the complete file was an multi-gigabyte disk image and the security solution was only meant to check a very small part of it).

This is only tangentially related to your problem, but I think it's a similar cause: you pass garbage data into OpenSSL, it tries to deal with it but fails, and the data isn't garbage enough that it can tell it's not a valid SSL header.

Here's what you can try:
  • Clean the compile cache.
  • Try building a Windows VM build to make sure there's no corrupted files in your project.
  • Make sure you have the appropriate Android SDK installed and linked in GM (you might need to re-link them just to make sure) and double-check that your connection with your testing device is working properly.
 
Thank you for a reply!
I cleaned the cache, tested with device, I upgraded Mono frameworks...still getting crashes. Firebase report says "Floria keeps stopping." Header too long".
It works absolutely fine as an APK build on any of the 6 devices I've tested.
I do need Google Apk extension because my file is 249MB, perhaps something there causing the issue?
 
Top