[英]Error when generate Gradle Wrapper files
我在ubuntu中有一个react native项目,并且我想生成Gradle Wrapper文件,所以我安装了gradle并在android/app
中运行了此命令
gradle wrapper --gradle-version 3.4.1
但是当我运行此命令时,出现此错误
FAILURE: Build failed with an exception.
* Where:
Build file '/var/MY_PROJECT/android/app/build.gradle' line: 122
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not get unknown property 'release' for SigningConfig container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我发生问题是因为我没有定义就调用了SigningConfig
所以我通过在/var/MY_PROJECT/android/app/build.gradle
定义SigningConfig
解决了这个问题
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
buildTypes { ... }
}
...
如果您想了解更多有关如何将签名配置添加到应用程序的gradle配置的信息,请单击此处
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.