SigningConfig“发布";缺少必需的属性"keyPassword" [英] SigningConfig "release" is missing required property "keyPassword"

查看:158
本文介绍了SigningConfig“发布";缺少必需的属性"keyPassword"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该错误提示我尚未设置signingConfig.release.keyPassword,但是我正在设置它.

The error complains that I have not set the signingConfig.release.keyPassword, however I am setting it.

我已经尝试过硬编码密码,而不是从key.properties文件中检索密码,但这无济于事.

I already tried hardcoding the password instead retrieving it from the key.properties file however that didn't help.

// 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
        }
    }
} 

推荐答案

尝试一下:在 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 Configs :
文件> 项目结构>选择模块>选择签名配置.在 Signing Configs 中,已经创建了 debug 配置,但是您可以通过按 + 图标来创建一个新的配置.

Also you can create Signing Configs in Android Studio:
File > Project Structure > Select Modules > Select Signing Configs. In Signing Configs, there is debug config is already created but you can create a new one by pressing the + icon.

这篇关于SigningConfig“发布";缺少必需的属性"keyPassword"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆