简体   繁体   English

无法将 Phonegap 构建的 APK 上传到 Google Play 控制台

[英]Unable to upload Phonegap built APK to Google Play Console

I have just tried to upload a APK (as a beta release) generated from Phonegap Build to the Google Play Store.我刚刚尝试将从 Phonegap Build 生成的 APK(作为 beta 版本)上传到 Google Play 商店。

Getting an error as follows:得到如下错误:

Upload failed

You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play.

When I generated the apk from Phonegap the debuggable option is unmarked.当我从 Phonegap 生成 apk 时,可调试选项未标记。

Any idea?任何想法? Almost same application was uploaded last year and I didn't get that error.去年上传了几乎相同的应用程序,我没有收到该错误。

First, generate your private key using the keytool command that comes with the JDK using the following command首先,使用 JDK 附带的 keytool 命令生成您的私钥,使用以下命令

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

For more information visit Generating a private key有关更多信息,请访问生成私钥

Then create a file build.json like below and put it in your <projectfolder>/buildConfig folder然后像下面一样创建一个文件 build.json 并将它放在你的<projectfolder>/buildConfig文件夹中

{
 "android": {
     "release": {
         "keystore": "my-release-key.keystore",
         "alias": "alias_name",
         "storePassword": "secretPassword",
         "password" : "secretPassword"
     }
 }
}

Keep your my-release-key.keystore file in <projectfolder>/buildConfig folder将 my-release-key.keystore 文件保存在<projectfolder>/buildConfig文件夹中

Then execute the following command然后执行以下命令

ionic cordova build android --prod --release --buildConfig ./buildConfig/build.json

The solution was adding an Android Key and to enable it.解决方案是添加一个 Android 密钥并启用它。 Without iOS or Android key the build won't work.如果没有 iOS 或 Android 密钥,构建将无法工作。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM