Unity2018打包APK上传Google Play遇Debug签名错误求助
Problem Description
I'm developing an Android app using Unity 2018 and when uploading my APK to Google Play Console, I get this error:
You uploaded an APK or Android App Bundle that was signed in debug mode. You need to sign your APK or Android App Bundle in release mode
The "Learn more" link only covers release signing for Android Studio, and the referenced Q1/Q2 didn't help. I followed these steps from the Unity forums to sign my build in release mode:
- Navigated to PlayerSettings > Publishing Settings
- Created a new keystore and set passwords (confirmed both)
- Under Key Alias, selected "Create a new key"
- Filled in all required details in the pop-up window
- Selected the newly created key
- Built the APK with signing enabled
Even after uploading this newly signed APK, the error persists. Note that I've already disabled the Google-managed app signing key option.
Solution
Let’s walk through the most likely fixes for this frustrating issue—Unity 2018 has a few specific gotchas with Android release signing that might be tripping you up:
1. Don’t Overlook Build Mode Selection
First, double-check the absolute basics:
- Open File > Build Settings
- Make sure Android is your target platform
- Under the Build section, confirm Build Configuration is set to
Release(not Debug) - If it was set to Debug, click Switch Platform before rebuilding—this is an easy mistake to make!
2. Verify Your Publishing Settings Are Actually Applied
Even if you created a keystore, Unity might not be using it correctly:
- Head to Edit > Project Settings > Player > Android > Publishing Settings
- In the Keystore Manager section, make sure your custom keystore is selected (not Unity’s default debug keystore)
- Confirm your key alias is showing up, and double-check the passwords (use the "Show Password" toggle to avoid typos)
- Ensure the Sign the APK box is checked—it should be enabled automatically when you select a keystore, but it never hurts to confirm
3. Wipe Old Builds and Clean Your Project
Cached debug files can linger and cause conflicts:
- Delete your entire build folder (where you’re exporting the APK)
- In Unity, go to Assets > Reimport All to clear any cached assets
- Rebuild the APK from scratch, making sure to walk through the signing steps carefully again
4. Check If Your Keystore Is Valid
Sometimes the keystore you created might be corrupted or incomplete:
- Use the
keytoolcommand from your JDK installation to verify it:keytool -list -v -keystore your_keystore_name.keystore - Enter your keystore password when prompted. If it returns details about your key alias and certificate, you’re good. If it throws an error, recreate the keystore slowly—don’t rush through the setup fields.
5. Disable Debugging Flags in Player Settings
Unity might be sneaking debug flags into your release build without you noticing:
- Go to Edit > Project Settings > Player > Android > Other Settings
- Under Configuration, confirm your Scripting Backend is set to whatever you’re using (IL2CPP or Mono)
- Scroll down to the Debugging section and uncheck Development Build, Script Debugging, and Autoconnect Profiler—all of these can mark your build as debug even if you selected release mode
6. Fall Back to Manual Signing
If Unity’s built-in signing is still failing, try signing the APK manually:
- Build an unsigned APK from Unity (uncheck "Sign the APK" in Publishing Settings)
- Use
jarsignerto sign it:jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore your_keystore_name.keystore unsigned_apk_name.apk your_key_alias - Optimize it with
zipalign(required for Google Play):zipalign -v 4 signed_apk_name.apk final_apk_name.apk - Upload this final, manually signed APK to the Play Console
内容的提问来源于stack exchange,提问作者Indrajith Ekanayake




