android - react native Android : Task :app:validateSigningRelease FAILED

标签 android react-native gradle

我已经使用 Microsoft App Center 设置了 ci/cd。它与调试 APK 完美配合,但在构建发布 APK 时出现错误。证书已上传,应用程序中的所有设置均已正确设置。没有这样的问题,当我尝试构建它时,使用 npm 命令:
"android-release": "cd android && ./gradlew assembleRelease"

可能是什么问题?

> Task :app:validateSigningRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> 
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
Keystore file '/Users/vsts/agent/2.150.0/work/1/s/android/app/my-release-key.keystore' not found for signing config 'release'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 34s
22 actionable tasks: 21 executed, 1 up-to-date
Error: /Users/vsts/agent/2.150.0/work/1/s/android/gradlew failed with return code: 1
    at ChildProcess.<anonymous> (/Users/vsts/agent/2.150.0/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
##[error]Error: /Users/vsts/agent/2.150.0/work/1/s/android/gradlew failed with return code: 1
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
##[section]Finishing: Gradle Task
##[section]Starting: Checkout

最佳答案

如果您关注这一行错误:

Keystore file '/Users/vsts/agent/2.150.0/work/1/s/android/app/my-release-key.keystore' not found for signing config 'release'.

这是说找不到 keystore ,因此请验证它存在于 android/app 目录内的合适位置,并验证您是否已添加

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****

在你的 android/gradle.properties 文件中。

关于android - react native Android : Task :app:validateSigningRelease FAILED,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55814600/

相关文章:

java - Android 永远循环/重复数学的最快和最正确的方法是什么?

android - 在 Android 中的串行蓝牙打印机上打印位图

android - 退出 Expo 后无法运行 React Native 应用程序

android - 在 Unity 中为 Android 构建 Gradle 失败,说找不到 intellij-core.jar

Android 架构组件 : Gradle sync error for dependency version

android - Rxjava 对象过滤列表

android - AccountAuthenticatorActivity 和 Fragments

javascript - React setState 不起作用,它的回调也不起作用

java - 无法在 Android Studio 上构建应用程序,谷歌服务冲突

intellij-idea - Intellij+Springboot+Thymeleaf+gradle - 自动重载html资源