【问题标题】:How to fix "Your Android App Bundle is signed with the wrong key"?如何修复“您的 Android App Bundle 使用错误的密钥签名”?
【发布时间】:2021-01-21 01:11:30
【问题描述】:

我正在尝试上传我的 appbundle,但一直收到此错误“您的 Android App Bundle 使用错误的密钥签名”。我已经用谷歌重置了我的密钥,等了 48 小时,但我仍然收到错误消息。我在我的key.properties 上使用新的keystore.jks 文件,与我作为pem 文件发送给google 的文件相同。

这是我的key.properties

storePassword=******
keyPassword=******
keyAlias=key
storeFile=/Users/ricardooscarkanitz/Projects/Apps/e_ai_casimiro_key/keystore.jks

还有我的build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
  localPropertiesFile.withReader('UTF-8') { reader ->
    localProperties.load(reader)
  }
}

def  flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
     throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in  
the local.properties file.")    
   }

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
   flutterVersionCode = '2'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '2.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

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 "br.com.kanitzdev.e_ai_casimiro"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled true
 }

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


 buildTypes {
         release {
            signingConfig signingConfigs.debug
      }
    }
 }

 flutter {
     source '../..'
  }

dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}

apply plugin: 'com.google.gms.google-services'

我已经尝试上传我第一次从keytool 获得的key.jks 文件,但它显示了同样的错误。各位大侠有什么解决办法吗?

【问题讨论】:

    标签: flutter google-play-console


    【解决方案1】:

    您仍在尝试通过调试模式生成应用程序包。

    而不是: signingConfig signingConfigs.debug

    试试这个: signingConfig signingConfigs.release

    【讨论】:

      猜你喜欢
      • 2021-04-15
      • 1970-01-01
      • 2023-01-17
      • 1970-01-01
      • 2019-03-01
      • 2020-10-02
      • 2019-07-09
      • 2021-09-21
      • 1970-01-01
      相关资源
      最近更新 更多