You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode error

半腔热情 提交于 2019-12-03 13:15:33

I don't know how you do that in Maven, but you need to compile your app with a release keystore. You can create one with keytool, which is available in your Java bin folder:

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

When creating it, you must supply two passwords, one for the keystore and one for the key. When your keystore is created, you can use the Eclipse Export wizard to compile your app in release mode.

For further details, please refer to http://developer.android.com/tools/publishing/app-signing.html#releasemode

Always create your keystore with name and alias containing "release" not "debug". If you are having the "You uploaded an APK that was signed in debug mode. You need to sign your APK in release mode error" it's certain that you are using default keystore which is 'debug.keystore' hence generating apk in debug mode.

Solution

  1. Generate new keystore
  2. Give reference in build.gradle file
  3. Change build variant to 'release'
  4. Build

this should fix the issue.

Using -genkeypair instead of -genkey solved the problem for me.

So: keytool -genkeypair -keystore name.keystore -alias nameapp -keyalg RSA

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!