简体   繁体   English

您已在调试模式下发送了签名的 APK 或 Android App Bundle。 在发布模式下签名。 如何修复它(颤振)

[英]You have sent a signed APK or Android App Bundle in debug mode. Sign it in release mode. How to fix it (flutter)

I have to generate an APK to publish the app in Google Play Store, so I did this steps:我必须生成一个 APK 才能在 Google Play 商店中发布应用程序,所以我执行了以下步骤:

  • run keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key and paste the file key.jks inside android/app运行keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key并将文件 key.jks 粘贴到 android/app
  • create a file in android folder named key.properties with this content:在 android 文件夹中创建一个名为key.properties的文件,其中包含以下内容:
storePassword=myPass
keyPassword=myPass
keyAlias=KEY
storeFile=/app/key.jks
  • added this code in app/build.gradle:在 app/build.gradle 中添加了这段代码:
def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }
  • Pasted this code in app/build.gradle:将此代码粘贴到 app/build.gradle 中:
    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now,
            // so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
  • Run flutter clean运行flutter clean

  • Run flutter build apk --split-per-abi --release :运行flutter build apk --split-per-abi --release

But when I send the apks to google play publish I receive this message:但是,当我将 apk 发送到 google play publish 时,我会收到以下消息:

You have sent a signed APK or Android App Bundle in debug mode.您已在调试模式下发送了签名的 APK 或 Android App Bundle。 Sign it in release mode在发布模式下签名

What I need to do?我需要做什么?

Remove the duplicate buildType release删除重复的buildType release

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now,
            // so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

Or rename to debug .或重命名为debug

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
    debug {
        signingConfig signingConfigs.debug
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您上传了在调试模式下签名的 APK。 您需要在发布模式错误中签署您的 APK - You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode error 您上传了以调试模式签名的APK。 您需要在发布模式下签署APK - You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode 您上传了在调试模式下签名的 APK 或 Android App Bundle - You uploaded an APK or Android App Bundle that was signed in debug mode flutter apk 在发布模式下不起作用。 帮我 - flutter apk not work in release mode. HELP ME 应用在发布模式下失败。 怎么知道为什么? - App fails in release mode. How to know why? 在发布模式下使用 firebase auth 在 Android 上登录失败。 DEBUG 模式正常。 代码=10,消息=10,mPendingCredential=null - Failure to login using firebase auth on Android in release mode. DEBUG mode is OK. Code=10, message=10,mPendingCredential=null MVVMCross:Color Plugin会产生编译错误,但仅在Release模式下。 在调试模式下,它可以编译 - MVVMCross: Color Plugin produces compilation error but only in Release mode. In Debug mode it compiles OK Apk仅在调试模式下运行。 Apk以Eclipse中的“Run”开始在断点处停止 - Apk only runs in debug mode. Apk started with “Run” in Eclipse stops on breakpoints 在调试器模式下,带有Kotlin插件的Android Studio 1.5出现异常。 如何解决? - Android Studio 1.5 with Kotlin Plugin got exception, when is in debugger mode. How to fix it? 如何防止我的应用进入睡眠模式。 - How to prevent my app to go sleep mode.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM