Android 无法将更新的 APK 上传到 Google Play 商店
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20051192/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to Upload Updated APK to Google Play Store
提问by patrickSmith
The same issue was posted herebut the answer given didn't work for me. I've uploaded to the store before and now I can't update my app to include some bug fixes. Whenever I try to upload the APK I get this error
此处发布了相同的问题,但给出的答案对我不起作用。我之前已经上传到商店,现在我无法更新我的应用程序以包含一些错误修复。每当我尝试上传 APK 时,我都会收到此错误
Upload failed
You uploaded a debuggable APK. For security reasons you need to disable debugging before it can be published in Google Play.
上传失败
您上传了一个可调试的 APK。出于安全原因,您需要先禁用调试,然后才能在 Google Play 中发布。
I've tried adding Android:debuggable="false" to my manifest but I'm still getting the same message.
我已经尝试将 Android:debuggable="false" 添加到我的清单中,但我仍然收到相同的消息。
I'm currently using Android Studio to generate my signed APK.
我目前正在使用 Android Studio 生成我的签名 APK。
Edit Here's my AndroidManifest.xml
编辑这是我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aventuracctv.aventurafibercalculator"
android:versionCode="3"
android:versionName="1.2"
android:debuggable="false">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="Fiber Calculator"
android:theme="@style/AppTheme">
<activity
android:name="com.aventuracctv.aventurafibercalculator.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
回答by SharkAlley
It seems you now have to explicitly set android:debuggable=false. (At least with the Android Studio 0.3.6.)
看来您现在必须明确设置android:debuggable=false。(至少使用 Android Studio 0.3.6。)
Debuggable is a property of the applicationtag. (Not the manifest tag.)
Debuggable 是应用程序标签的一个属性。(不是清单标签。)
<application
android:debuggable="false"
... more attributes
If you've added this attribute properly and Google Play still rejects your APK, try modifying build.gradle to set your own key for debug
如果您已正确添加此属性但 Google Play 仍拒绝您的 APK,请尝试修改 build.gradle 以设置您自己的调试密钥
signingConfigs {
debug {
storeFile file("my-keystore-file.jks")
storePassword "my-password"
keyAlias "my-alias"
keyPassword "my-password"
}
}
回答by 6thSigma
Assuming you're using 'Build > Generate Signed APK' in Android Studio and assuming you're using Gradle, you will now have to configure Gradle to sign your apk. The reason being that button in Android Studio doesn't run 'gradle assembleRelease' which would make your apk non-debuggable.
假设您在 Android Studio 中使用“Build > Generate Signed APK”并假设您使用的是 Gradle,那么您现在必须配置 Gradle 来对您的 apk 进行签名。原因是 Android Studio 中的按钮不会运行“gradle assembleRelease”,这会使您的 apk 无法调试。
Follow the instructions that pop up when you click on Generate Signed APK.
按照单击生成签名 APK 时弹出的说明进行操作。
For Gradle-based projects, the signing configuration should be specified in the Gradle build scripts. Configure your signing configurations as described in the user guide: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations
Then, run "gradle assembleRelease", and you will find your APK in the build/apk/ directory.
对于基于 Gradle 的项目,签名配置应在 Gradle 构建脚本中指定。按照用户指南中的说明配置您的签名配置:http: //tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations
然后,运行“gradle assembleRelease”,您将在 build/apk/ 目录中找到您的 APK。
Hopefully Google either fixes the Generate Signed APK button in Android Studio or they revert the Play Store back to allow debuggable APKs again until they fix Gradle/Android Studio.
希望谷歌要么修复 Android Studio 中的 Generate Signed APK 按钮,要么恢复 Play Store 以再次允许可调试的 APK,直到他们修复 Gradle/Android Studio。
回答by Mahamadali
You just have to set Build variants if you are on android studio.
如果您使用的是 android studio,则只需设置 Build 变体。
Flow => Go to Build Variants -> From Build variant -> Select release mode
流程 =>转到构建变体 -> 从构建变体 -> 选择发布模式
Here you just have to set the mode as release not debug.
在这里,您只需将模式设置为发布而不是调试。
NOTE : This is for security of your apk on google play store.
注意:这是为了您在 google play 商店上的 apk 的安全。
FOR NON-ANDROID-STUDIO users :
对于非 ANDROID-STUDIO 用户:
Here we just have to set the android:debuggable="false"in application tag of your menifest file and you are done.
在这里,我们只需要在您的清单文件的应用程序标签中设置android:debuggable="false"就可以了。
And you are out of your issue.
你没有问题。
Thanks and feel free to comment ...
感谢并随时发表评论...
回答by Mohammed Javad
In build.gradle(Module:app) make the debuggable as false
在 build.gradle(Module:app) 中将 debuggable 设为 false
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable false
}
}
回答by Derek Gogol
Google Play will not accept a debug version of your .apk file. You can only upload an .apk compiled as release version. Additionally it must be signed with your Android Developer key, which happens in the same step, at least if you're using Eclipse.
Google Play 不会接受您的 .apk 文件的调试版本。您只能上传编译为发布版本的 .apk。此外,它必须使用您的 Android 开发人员密钥进行签名,这发生在同一步骤中,至少在您使用 Eclipse 时是这样。
Make sure you distribute an .apk file which is your Signed Release version, as described here:
确保您分发了一个 .apk 文件,它是您的签名发布版本,如下所述:
http://developer.android.com/tools/publishing/app-signing.html#releasecompile
http://developer.android.com/tools/publishing/app-signing.html#releasecompile
回答by user3006708
I assume that you have updated your android studio to 0.3.6.
我假设您已将 android studio 更新到 0.3.6。
check this one:
检查这个:
Android Studio generate signed apk not working on build 0.3.6 - Giving Error
Android Studio 生成签名的 apk 无法在构建 0.3.6 上运行 - 出现错误
and also as 6thSigma said: run "gradle assembleRelease"
也正如 6thSigma 所说:运行“gradle assembleRelease”
回答by Stefano
I think, that you have to set it as "false" in order to disable the debug.
我认为,您必须将其设置为“false”才能禁用调试。