Could not get unknown property 'myConfig' for SigningConfig container.

版权声明:文章转载请标明出处,谢谢! https://blog.csdn.net/huang3513/article/details/78020104

错误日志:
Error:(56, 1) A problem occurred evaluating project ‘:app’.

Could not get unknown property ‘myConfig’ for SigningConfig container.

说明:做项目的时候,往往很低级的错误也会不断的出现,今天我就碰到了(当时受到了十吨的伤害啊),

signingConfigs {
        debug {
            storeFile keyfile
            storePassword keystorePSW
            keyAlias keystoreAlias
            keyPassword keystoreAliasPSW
            println("====== signingConfigs.debug ======")
        }
        myConfig {
            storeFile keyfile
            storePassword keystorePSW
            keyAlias keystoreAlias
            keyPassword keystoreAliasPSW
            println("====== signingConfigs.release ======")
        }

就是在这段代码,放在了

 //签名文件存在,则签名
            if (keyfile.exists()){
                println("WITH -> buildTypes -> release: using jks key")
                signingConfig signingConfigs.myConfig
            }else{
                println("WITH -> buildTypes -> release: using default key")
            }

之后引用,加载不到。所有在大家使用的时候,尽量注意细节,小的问题。

猜你喜欢

转载自blog.csdn.net/huang3513/article/details/78020104