Android 为什么我要在gradle签qa?
我的gradle文件中有这个构建配置吗Android 为什么我要在gradle签qa?,android,gradle,key,sign,android-productflavors,Android,Gradle,Key,Sign,Android Productflavors,我的gradle文件中有这个构建配置吗 buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } debug { applicationIdSuffix ".debug"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
applicationIdSuffix ".debug"
versionNameSuffix ".debug"
}
qa {
applicationIdSuffix ".qa"
versionNameSuffix ".qa"
}
}
sourceSets { debug { res.srcDirs = ['src/debug/res', 'src/debug/res/values'] } }
}
为什么当我试图运行qa时,它会因为没有这种风格的键而出错?Gradle可以“开箱即用”构建项目的唯一构建类型是
debug
,因为Gradle的Android插件知道使用插件创建的调试签名密钥库。对于其他事项,您需要:
- 配置一个单独的签名密钥库(例如,用于
)发行版
- 从
生成类型初始化新生成类型,类似于使用复制构造函数,因此它使用与debug
签名相同的规则debug
mezzanine
构建类型,为它提供与release
相同的签名配置。因此,我使用mezzanine.initWith(buildTypes.release)
将mezzanine
设置为release
的副本,然后继续使用不同的规则对其进行配置:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
versionCode 2
versionName "1.1"
minSdkVersion 14
targetSdkVersion 18
}
signingConfigs {
release {
storeFile file('HelloConfig.keystore')
keyAlias 'HelloConfig'
storePassword 'laser.yams.heady.testy'
keyPassword 'fw.stabs.steady.wool'
}
}
buildTypes {
debug {
applicationIdSuffix ".d"
versionNameSuffix "-debug"
}
release {
signingConfig signingConfigs.release
}
mezzanine.initWith(buildTypes.release)
mezzanine {
applicationIdSuffix ".mezz"
debuggable true
}
}
}
在您的情况下,在配置
qa
构建类型的其余部分之前,您可以使用qa.initWith(buildTypes.debug)
之类的东西。Gradle可以“开箱即用”构建项目的唯一构建类型是debug
,因为Gradle的Android插件知道使用插件创建的调试签名密钥库。对于其他事项,您需要:
- 配置一个单独的签名密钥库(例如,用于
)发行版
- 从
生成类型初始化新生成类型,类似于使用复制构造函数,因此它使用与debug
签名相同的规则debug
mezzanine
构建类型,为它提供与release
相同的签名配置。因此,我使用mezzanine.initWith(buildTypes.release)
将mezzanine
设置为release
的副本,然后继续使用不同的规则对其进行配置:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
versionCode 2
versionName "1.1"
minSdkVersion 14
targetSdkVersion 18
}
signingConfigs {
release {
storeFile file('HelloConfig.keystore')
keyAlias 'HelloConfig'
storePassword 'laser.yams.heady.testy'
keyPassword 'fw.stabs.steady.wool'
}
}
buildTypes {
debug {
applicationIdSuffix ".d"
versionNameSuffix "-debug"
}
release {
signingConfig signingConfigs.release
}
mezzanine.initWith(buildTypes.release)
mezzanine {
applicationIdSuffix ".mezz"
debuggable true
}
}
}
在您的情况下,在配置
qa
构建类型的其余部分之前,您会使用类似qa.initWith(buildTypes.debug)
的东西。我感觉只有debug生成它自己的键,如果您没有请求其他方面的帮助,我不能使用debug键来实现我的qa风格?我需要它为不同的软件包名称的能力,有两个版本在我的手机上。顺便说一下,谢谢你的回答,非常详细helpful@JesusDimrix:“我不能为我的qa风格使用调试键?”——qa
是一种生成类型,根据您的问题。您可以使用qa
的调试签名键,如我在回答中所述。我感觉只有调试生成它自己的键如果您没有请求其他方面,我不能使用调试键作为我的qa风格?我需要它为不同的软件包名称的能力,有两个版本在我的手机上。顺便说一下,谢谢你的回答,非常详细helpful@JesusDimrix:“我不能为我的qa风格使用调试键?”——qa
是一种生成类型,根据您的问题。您可以使用qa
的调试签名键,如我的回答中所述。