当我来签署我的应用程序时,我有一个很大的问题:我已经按照文档设置了签名配置:
signingConfigs { release { storeFile file("lomapnew.keystore") storePassword "myPassword" keyAlias "myAlias" keyPassword "Something...." } }
但是我仍然收到以下错误消息:“应在Gradle构建脚本中指定签名配置”
解决方法
我要出门走走,猜测你还没有为发布构建类型设置签名配置.调试构建类型是自动的,因此这对于所有其他构建类型(包括发行版)都是必须的步骤并不明显.
您可以如下应用签名配置:
android { signingConfigs { // It's not necessary to specify,but I like to keep the debug keystore // in SCM so all our debug builds (on all workstations) use the same // key for convenience debug { storeFile file("debug.keystore") } release { storeFile file("release.keystore") storePassword "myPassword" keyAlias "myAlias" keyPassword "Something...." } } buildTypes { /* This one happens automatically debug { signingConfig signingConfigs.debug } */ release { signingConfig signingConfigs.release } } }