简体   繁体   English

将 Android App Bundle 上传到 Google Play 控制台 - 密钥签名错误

[英]Uploading Android App Bundle to Google Play Console - key signing error

I'm trying to upload a brand new.aab file to the Google Play Console, but keep getting this error:我正在尝试将全新的 .aab 文件上传到 Google Play 控制台,但不断收到此错误:

Upload failed上传失败
You uploaded an APK or Android App Bundle that is signed with a key that is also used to sign APKs that are delivered to users.您上传的 APK 或 Android App Bundle 已使用密钥进行签名,该密钥还用于对交付给用户的 APK 进行签名。 Because you are enrolled in App Signing by Google Play, you should sign your APK or Android App Bundle with a new key before you upload it.因为您注册了 Google Play 的 App Signing,所以您应该在上传之前使用新密钥对您的 APK 或 Android App Bundle 进行签名。

I'm completely stumped, as I generated a new key for this app bundle at the time of generating the app bundle, ie through the Build > Generate Signed Bundle / APK... menu item in Android Studio, so it is a brand new key, unused by other apps.我完全被难住了,因为我在生成应用程序包时为此应用程序包生成了一个新密钥,即通过 Build > Generate Signed Bundle / APK... Android Studio 中的菜单项,所以它是一个全新的密钥,未被其他应用程序使用。
I've even tried creating a whole new keystore with a new key in it, but always get the same error.我什至尝试创建一个全新的密钥库,其中包含一个新密钥,但总是出现相同的错误。 Is this some quirk someone else has come across?这是其他人遇到的一些怪癖吗?

When enrolling for App Signing by Google Play for this app, I chose the "Let Google manage and protect your app signing key (recommended)" option, and from all the documentation I've read, the key that you use to sign the app with first becomes the "Upload Key", so it seems like I'm doing everything correctly, but no dice.在为此应用程序注册 Google Play 应用程序签名时,我选择了“让 Google 管理和保护您的应用程序签名密钥(推荐)”选项,并从我阅读的所有文档中选择了您用于对应用程序进行签名的密钥with first 成为“上传密钥”,所以看起来我做的一切都是正确的,但没有骰子。

Does anyone have any advice, or past experience on this?有没有人对此有任何建议或过去的经验?

I am facing the same issues, in my case signinConfig was setup, I made one simple mistake, that I forget to change app debuggable to false .我面临同样的问题,在我的情况下signinConfig已设置,我犯了一个简单的错误,我忘记将 app debuggable 更改为false so even though I generated from menu or from gradle command, build was successfully generated but it was debuggable so play store not accepting signed apk and give me and message like Upload Failed The Android Bundle was not Signed in .因此,即使我从菜单或 gradle 命令生成,构建也已成功生成,但它是可调试的,因此 Play 商店不接受签名的 apk 并给我和类似Upload Failed The Android Bundle was not Signed in

Well, after a lot of screaming and shouting, including reaching out to Google Play Console support in chat (they're only first level support, so... not much help) and email (who put me in the too hard basket and said they can't offer support for app development - what? the problem is to do with uploading an app to Play Console, not app dev!), I discovered this self answered question https://stackoverflow.com/a/54359729/845205 .好吧,经过大量的尖叫和喊叫,包括在聊天中联系 Google Play Console 支持(他们只是一级支持,所以......没有太大帮助)和电子邮件(他们把我放在太难的篮子里并说他们不能为应用程序开发提供支持 - 什么?问题在于将应用程序上传到 Play Console,而不是应用程序开发!),我发现了这个自我回答的问题https://stackoverflow.com/a/54359729/845205 .

Basically, make sure you're doing a Clean & Rebuild Project whenever doing anything to do with signing in Android Studio.基本上,无论何时执行与登录 Android Studio 相关的任何操作,请确保您正在执行 Clean & Rebuild Project。 For some reason it thought my new app was using the key from my old app and kept signing with that.出于某种原因,它认为我的新应用程序使用了我旧应用程序中的密钥并继续使用该密钥进行签名。 (I guess the solution was app development support after all!) (我想解决方案毕竟是应用程序开发支持!)

make sure to change app debuggable to false in build.gradle file确保在 build.gradle 文件中将 app debuggable 更改为 false

在此处输入图片说明

"through the Build > Generate Signed Bundle / APK... menu item in Android Studio, so it is a brand new key, unused by other apps." “通过 Android Studio 中的 Build > Generate Signed Bundle / APK... 菜单项,因此它是一个全新的密钥,其他应用程序未使用。”

Not really.并不真地。 The keystore that Android Studio uses is associated with the Android SDK installation, so all the apps created from your Studio are signed with the same key. Android Studio 使用的密钥库与 Android SDK 安装相关联,因此从您的 Studio 创建的所有应用程序都使用相同的密钥进行签名。

What happened is that you must have created another app, signed it with that keystore, and uploaded it to the Play Console, thus making it a key used to sign APKs served to end users.发生的情况是您必须创建另一个应用程序,使用该密钥库对其进行签名,并将其上传到 Play 管理中心,从而使其成为用于签署提供给最终用户的 APK 的密钥。 At the same time, you created another app which you enrolled in Play Signing: for this app, the upload certificate is extracted from the first APK you upload.同时,您创建了另一个在 Play Signing 中注册的应用:对于这个应用,上传证书是从您上传的第一个 APK 中提取的。 Since you signed that APK with Studio as well, the same keystore was used.由于您也使用 Studio 签署了该 APK,因此使用了相同的密钥库。 Play detected that it was the same certificate for both those apps, and since you used the same key for two different purposes (app signing key for your first app, and upload key for your second app), Play rejected it. Play 检测到这两个应用程序的证书相同,并且由于您将相同的密钥用于两个不同的目的(第一个应用程序的应用程序签名密钥和第二个应用程序的上传密钥),Play 拒绝了它。 The reason is that an app signing key is much more important than an upload key (the latter can be reset while the first one can't), so you shouldn't use them for two different purposes.原因是应用签名密钥比上传密钥重要得多(后者可以重置而第一个不能),因此您不应将它们用于两个不同的目的。

In other words, you'll need to create a different keystore to sign your apps enrolled in Play Signing (ideally, one per app), and make sure you never use that keystore as an app signing key for another app.换句话说,您需要创建一个不同的密钥库来为您在 Play 签名中注册的应用程序签名(理想情况下,每个应用程序一个),并确保您永远不会将该密钥库用作另一个应用程序的应用程序签名密钥。

I hit this error in our apps.我在我们的应用程序中遇到了这个错误。 We use the same upload key for all of our apps.我们对所有应用程序使用相同的上传密钥。

So when you create a new app, make sure you select the option Use an existing key that you sign an app with instead of the (Google recommended) option which is to send them an unique upload key.因此,当您创建新应用程序时,请确保选择Use an existing key that you sign an app with选项Use an existing key that you sign an app with而不是(Google recommended)选项,即向他们发送唯一的上传密钥。

The really annoying part is that this option can only be selected once, so we had to delete our app and recreate it.真正令人讨厌的部分是这个选项只能选择一次,所以我们不得不删除我们的应用程序并重新创建它。

Try removing everything about the new app from console, then start by generating a new key and rebuilding the app with the new key.尝试从控制台删除有关新应用程序的所有内容,然后首先生成新密钥并使用新密钥重建应用程序。 Then you can re upload the new apk.然后你可以重新上传新的apk。

The solution for me turned out to be a matter of changing the build variant .我的解决方案原来是改变构建变体的问题

To recap, when I tried to upload my signed .aab bundle file into the Google Play Console for developers, I received this error The Android App Bundle was not signed.回顾一下,当我尝试将我签名的 .aab 包文件上传到 Google Play Console 以供开发人员使用时,我收到此错误Android App Bundle 未签名。

Keep in mind that this error is ambiguous and could be caused by a number of issues as visible in the other answers on this page.请记住,此错误是模棱两可的,可能是由本页其他答案中可见的许多问题引起的。 I had originally uploaded my app using the release build variant.我最初使用release版本变体上传了我的应用程序。 Forgetting what variant I had used originally, I tried to upload the debug build variant and got this error.忘记了我最初使用的变体,我尝试上传debug构建变体并出现此错误。

My fix : Upload the same build variant as the original one.我的修复:上传与原始版本相同的构建变体。 They must match!他们必须匹配!

The following solution worked for me.以下解决方案对我有用。 Add following two lines to your gradle file.将以下两行添加到您的 gradle 文件中。

    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        **signingConfig
        debuggable = false**
    }

我遇到了同样的问题,我通过删除我的应用程序并再次添加它来播放控制台来解决它。

The other way this can happen is if you have a signingConfig set up in the app build.gradle.另一种情况是,如果您在应用程序 build.gradle 中设置了签名配置。 It doesn't seem to matter what you specify in the signing section when you're making a bundle - even if you make a new one or choose some other keystore - it will use the one specified in the gradle file.在制作捆绑包时,您在签名部分指定的内容似乎无关紧要 - 即使您制作新的或选择其他密钥库 - 它也会使用 gradle 文件中指定的那个。

我也面临这个问题,我加入这行signingConfig signingConfigs.release在android系统>应用程序>的build.gradle> {buildType{release{ signingConfig signingConfigs.release }}}

In my case it was because I was choosing the debug folder instead of release folder in my project as the destination for the Android App Bundle.就我而言,这是因为我在我的项目中选择了调试文件夹而不是发布文件夹作为 Android App Bundle 的目标。

I needed the App Bundle for internal testing so I guess that's why it came natural to me to choose it.我需要 App Bundle 进行内部测试,所以我想这就是我很自然地选择它的原因。

i know this is an old issue but since i just hit this problem and my solution is not listed, i want to share it so it can help some future stackies.我知道这是一个老问题,但由于我刚刚遇到这个问题并且没有列出我的解决方案,所以我想分享它以便它可以帮助未来的一些堆栈。

My problem with signing the app was the entry testCoverageEnabled true which was inside the我签署应用程序的问题是条目testCoverageEnabled true位于

buildTypes{ release { ... }}

even though debuggable false was set, googles error message was Upload Failed The Android Bundle was not Signed or debuggable version was uploaded即使设置了debuggable false ,谷歌的错误消息是Upload Failed The Android Bundle was not Signeddebuggable version was uploaded

setting the testCoverageEnabled flag to false fixed my issue.将 testCoverageEnabled 标志设置为 false 解决了我的问题。

was facing similar issue when uploading aab to playstore from CI/CD, add从 CI/CD 将 aab 上传到 Playstore 时遇到类似问题,添加

signingConfig signingConfigs.release signingConfig 签名配置.release

in release config as follows在发布配置中如下

    release {
        signingConfig signingConfigs.release
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }

make sure you have included signing configs in build.gradle as follows确保您已在 build.gradle 中包含签名配置,如下所示

signingConfigs {
    release {
        storeFile file("$projectDir/dummy.keystore")
        keyAlias 'dummyAlias'
        storePassword 'dummyPassword'
        keyPassword 'dummyPassword'
    }
}

In my case I have就我而言,我有

debuggable true可调试的真

in. the correct value is false in. 正确值为false

buildTypes
     {
         release {

只需创建一个新密钥,它就会上传。

暂无
暂无

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

相关问题 Google Play 控制台 Play 应用签名 - Android App Bundle 未签名 - Google Play Console Play App Signing - The Android App Bundle was not signed (React Native) 如何将应用签名密钥上传到 Google Play 控制台? - (React Native) How to uploading App Signing Key to Google Play Console? 您的 Android App Bundle 使用错误的密钥 google play 控制台签名 - Your Android App Bundle is signed with the wrong key google play console 错误:“要上传 android 应用程序包,您必须注册 Google Play 应用程序签名” - Error: "To upload an android app bundle you must be enrolled in app signing by google play" 将应用上传到控制台时出错 - “上传失败,Android App Bundle 未签名。” - Error on uploading app to play console- "Upload failed The Android App Bundle was not signed ." 使用Google Play的应用签名,Android APK上传失败 - Android APK uploading failed using app signing by google play 将应用捆绑包上传到Play控制台时导入错误 - Import error while uploading app bundle to Play Console 将 *.aab 包上传到 Google Play 控制台问题 - Uploading *.aab bundle to Google play console Problem 如果让Google管理密钥,是否可以从Google Play控制台下载/访问Android应用签名密钥? - Can you download/access your Android app signing key from Google Play Console if you let Google manage keys? 无法通过 fastlane 使用 Google Play 应用签名将 android 捆绑包上传到 Google Play - Unable to upload android bundle to Google Play with Google Play app signing via fastlane
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM