SigningConfig“发布”缺少必需的属性“keyPassword”

Posted

技术标签:

【中文标题】SigningConfig“发布”缺少必需的属性“keyPassword”【英文标题】:SigningConfig "release" is missing required property "keyPassword" 【发布时间】:2019-09-11 06:40:20 【问题描述】:

错误提示我没有设置signingConfig.release.keyPassword,但是我正在设置它。

我已经尝试对密码进行硬编码,而不是从 key.properties 文件中检索它,但这并没有帮助。

// build.gradle file  

// ... the rest of the build code

android         

    signingConfigs 
        release 
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        
    

    buildTypes 
        release 
            signingConfig signingConfigs.release
        
    
 

【问题讨论】:

【参考方案1】:

试试这个:在build.gradle(Module: app)

// ... the rest of the build code

android 

    signingConfigs 
        release 
            storeFile file('your_key_store_path')
            storePassword 'your_store_password'
            keyAlias = 'your_key_alias'
            keyPassword 'your_key_password'
        
    

    buildTypes 
        release 
            signingConfig signingConfigs.release
        
    

您也可以在Android Studio 中创建Signing ConfigsFile > Project Structure > 选择Modules > 选择Signing Configs。 在Signing Configs 中,已经创建了debug 配置,但是您可以通过按+ 图标来创建一个新配置。

【讨论】:

以上是关于SigningConfig“发布”缺少必需的属性“keyPassword”的主要内容,如果未能解决你的问题,请参考以下文章