簡體   English   中英

您上傳了在調試模式下簽名的 APK 或 Android App Bundle

[英]You uploaded an APK or Android App Bundle that was signed in debug mode

我正在嘗試將我的 AAB 文件上傳到 Google Play 商店,我按照這個https://facebook.github.io/react-native/docs/signed-apk-android生成 .aab 文件,但我得到了這個錯誤您上傳了在調試模式下簽名的 APK 或 Android App Bundle。 您需要在發布模式下對您的 APK 或 Android App Bundle 進行簽名。

在 android/app/build.gradle

 buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

改成

buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

這是 Flutter 和 React Native 的問題。 更簡單地說, android/app/build.gradlebuildTypesrelease塊需要包含signingConfigs.release而不是signingConfigs.debug

buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

這在 Flutter文檔中有所顯示,但沒有明確說明。 我看到有兩個人在最后一天想念它。

除非您需要這些選項,否則不需要minifyEnabledproguardFiles

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM