Android Studio 指定签名证书文件
2017-07-20 21:42
281 查看
1.先参照Android
Studio中创建keystore生成指定的证书文件。
2.在app/build.gradle文件中增加 signingConfigs字段:如下所示:
注意1. storeFile, storePassword, keyAlias, keyPassword缺一不可,都必须填写,并且填写正确。如果没有填写 keyAlias,则签名时候会报告 Android-APK signing error : Failed toread key from keystore密码不正确的时候,会报告 Java.security.UnrecoverableKeyException: Cannot recoverkeyThis exception may result from the fact that you had provided a key password that wasdifferent from the keystore password2.对于 Release配置,在 buildTypes中必须指定
否则,会出现
3. signingConfigs必须在 buildTypes前面声明,否则会出现找不到配置选项的错误。
Studio中创建keystore生成指定的证书文件。
2.在app/build.gradle文件中增加 signingConfigs字段:如下所示:
12345678910111213141516171819202122232425262728293031323334353637383940 | apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { applicationId "com.test.example" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } signingConfigs { debug { File strFile = new File("../../Keystore/Debug/debug.jks") storeFile file(strFile) storePassword "storeDebug1234567890" keyAlias "debugkey" keyPassword "aliasDebug1234567890" //println strFile.absolutePath; } release { File strFile = new File("../../Keystore/Release/release.jks") storeFile file(strFile) storePassword "storeRelease1234567890" keyPassword "keyRelease1234567890" keyAlias "releasekey" // println strFile.absolutePath; } } buildTypes { release { signingConfig signingConfigs.release runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }} |
1 | signingConfigsigningConfigs.release |
1 | Error:Theapkforyourcurrentlyselectedvariant(app-release-unsigned.apk)isnotsigned.pleasespecifyasigningconfigurationforthisvariant(release) |
相关文章推荐
- Android Studio 指定签名证书文件
- Android Studio生成APK自动追加版本号、自定义apk名称、指定签名证书文件
- Android Studio 指定签名证书文件
- Android Studio 签名证书文件在build.gradle(app)中配置
- android studio生成签名文件,以及SHA1和MD5值
- IOS证书/私钥/代码签名/描述文件
- 安装WP8 SDK出现“根据当前系统时钟或签名文件中的时间戳验证时要求的证书不在有效期内”的解决办法
- Android Studio使用Eclipse的签名文件进行打包
- 支付宝C# RSA签名 报系统找不到指定的文件问题解决
- android studio 怎么引入签名文件
- 沃通EV代码签名证书被微软指定用于windows10内核签名
- Android Studio中获取查看签名SHA1证书指纹数据或MD5的方法
- android studio开发环境配置(指定SDK及卸载)附安装文件网盘地址(win7 64位)
- Android Studio Gradle多渠道打包(动态设定App名称,应用图标,背景图片,状态栏颜色)、配置签名文件
- 在Android studio 下 获取SHA1 签名证书
- 【Android】如何创建自己的证书文件,如何为apk以及zip文件签名 openssl
- Android Studio打包获取签名文件
- Android Studio获取Android签名证书的sha1值
- Java数字证书对文件、加密、解密、签名、校验签名(一)
- Android studio运行添加签名文件