背景:第一次使用AndroidStudio导入GitHub的开源项目,报错:
Could not get unknown property ‘RELEASE_STORE_FILE’ for SigningConfig_Decorated{name=myConfig, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=null, v1SigningEnabled=true, v2SigningEnabled=true} of type com.android.build.gradle.internal.dsl.SigningConfig.
原因:在build.gradle(Module:app)里面RELEASE_STORE_FILE、RELEASE_KEY_ALIAS、RELEASE_KEY_PASSWORD、RELEASE_STORE_PASSWORD没有赋值
解决方法:把这些签名信息添加到gradle.properties:
RELEASE_KEY_PASSWORD = 123456
RELEASE_KEY_ALIAS = releaseKey
RELEASE_STORE_PASSWORD = 123456
RELEASE_STORE_FILE = key/releaseKey.jks