gpt4 book ai didi

android - 在 Release模式下 flutter 构建 appbundle

转载 作者:行者123 更新时间:2023-12-04 12:05:06 26 4
gpt4 key购买 nike

我已经使用 android studio 在 flutter 中构建了一个应用程序,并试图在 Play 商店中发布它。
根据https://flutter.dev/docs/deployment/android#reviewing-the-build-configuration , "运行 flutter build appbundle (运行 flutter 构建默认为发布构建。)"
enter image description here
enter image description here
但是,当我尝试在播放控制台上上传此内容时,我收到错误消息“您上传了一个在 Debug模式下签名的 APK 或 Android App Bundle。您需要在 Release模式下签署您的 APK 或 Android App Bundle。”
enter image description here
我应该怎么做?
从我的 gradle.build :


def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 29

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.rtterror.custom_snooze_alarm"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

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
}
}
}

最佳答案

尝试修改您的 buildTypes block 。

buildTypes {
release {
signingConfig signingConfigs.release
}
}

关于android - 在 Release模式下 flutter 构建 appbundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65640066/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com