Closed freesonfish closed 6 years ago
还有 app build.gradle 一堆变量都没见有定义 pStoreFile、pStorePassword、pKeyAlias、pKeyPassword
建议直接把build.gradle的相关代码删掉,
buildTypes {
// 将pToken使用 "" 代替!
release {
buildConfigField "String", "UPDATE_TOKEN", pToken
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
buildConfigField "String", "UPDATE_TOKEN", pToken
}
}
//signing files settings
signingConfigs {
if (propertyHaveSigningConfigs) {
debug {
storeFile file(pStoreFile)
storePassword pStorePassword
keyAlias pKeyAlias
keyPassword pKeyPassword
}
release {
storeFile file(pStoreFile)
storePassword pStorePassword
keyAlias pKeyAlias
keyPassword pKeyPassword
}
}
}
都删掉。 因为是个人秘钥和token,所以做处理了。
变量在一个本地可忽略的配置文件里,因为上传忽略了,所以克隆下来看不见,把关于签名的部分删掉,把pToken用空字符串代替就好了
@freesonfish 项目根目录新建 gradle.properties 文件,里面添加pToken = "xx"
@freesonfish 已更正,下载最新的包即可!
完整提示:Error:(21, 0) Could not get unknown property 'pToken' for BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.