Sha*_*tef 7 android android-studio
我keystore.properties在根文件夹中有以下密钥存储信息存储
storePassword=******
keyPassword=******
keyAlias=******
storeFile=/home/jerry/jerryKeyStore
Run Code Online (Sandbox Code Playgroud)
和以下gradle代码来加载它
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("keystore.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
Run Code Online (Sandbox Code Playgroud)
当我打开项目结构窗口的签名选项卡时,Android Studio 会读取Unrecognized value所有签名字段。它也无法在我的设备上安装 APK,抛出一个错误,即 APK 是用不同的密钥构建的......因为我使用直接写入 gradle 文件的签名信息构建它
我使用以下
Android Studio:2.1.2
Gradle:2.1.0
确保你有:
buildTypes {
debug {
signingConfig signingConfigs.debug
......
}
release {
signingConfig signingConfigs.release
...
}
}
Run Code Online (Sandbox Code Playgroud)
模块中。
| 归档时间: |
|
| 查看次数: |
1923 次 |
| 最近记录: |