【发布时间】:2019-07-17 22:02:08
【问题描述】:
我按照official flutter page. 中的说明一步一步创建了一个密钥和密钥库并签署了我的 apk
但是当我尝试将它上传到 Google Play 控制台时,我收到了这个错误:
“您上传的 APK 或 Android App Bundle 在调试模式下签名。您需要在发布模式下签名您的 APK 或 Android App Bundle”
A similar question 之前被问过,但它没有解决我的问题。
这是我的 app/build.gradle 的相关部分:
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "my.package.name"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
这是我的 Android Studio 版本的屏幕截图(Android SDK 是红色的不相关。):
我的 output.json 文件:
[
{
"outputType": {
"type": "APK"
},
"apkInfo": {
"type": "MAIN",
"splits": [
],
"versionCode": 1,
"versionName": "1.0.0",
"enabled": true,
"outputFile": "app-release.apk",
"fullName": "release",
"baseName": "release"
},
"path": "app-release.apk",
"properties": {
}
}
]
【问题讨论】:
标签: android flutter google-play-console