• General Chat
  • During Android export, why does it say Invalid public key of apk expansion?

First, I have gone through all of the official documentation several times in order to properly configure Godot for Android Export and compiling. When I open the export window, The following error is displayed in bottom left corner of the Export window when trying to export for Android: "Invalid public key for apk expansion" The "Export Project" button is also greyed out. What am I supposed to put in the "Public Key" field when exporting for Android? What else should I consider?

Ok, I found the issue. I only needed to deselect the APK Expansion option in the Android export settings. It was selected by default.

6 years later

Here are some common reasons for encountering this error during Android export:

Mismatched Key Pair:

Ensure that the public key you are using for the APK expansion file matches the private key used to sign your APK.
If you regenerated or changed your signing key, make sure to update both the main APK and expansion file with the new key pair.
Corrupted or Invalid Public Key:

Check the integrity of the public key used for signing the expansion file. If it's corrupted or invalid, it may cause verification failures.
Verify that the key is in the correct format and hasn't been modified.
Incorrect Configuration:

Ensure that the expansion file's public key is correctly specified in your Android project's configuration files.
Double-check the configuration files (such as the play_licensing_public_key in your AndroidManifest.xml) to make sure the key is accurate.
Play Console Configuration:

If you are using Google Play's expansion file hosting, ensure that the public key specified in your project matches the one configured in the Google Play Console.
Verify that the expansion file is uploaded correctly in the Google Play Console.
Proguard Configuration:

If you are using Proguard for code obfuscation, make sure it doesn't interfere with the expansion file's public key verification process.
Network Issues:

Sometimes, issues during the export process or network problems may result in corrupted expansion files. Ensure a stable internet connection during the export.