反应本机任务:app:validateSigningDebug失败

Noo*_*der 14 react-native

我对react-native和android完全陌生。我已经下载从GitHub项目和使用的命令yarn install,并react-native run-android运行该项目。但出现此错误。似乎无法理解原因。我该怎么办?

info Starting JS server...
info Installing the app...
> Task :app:validateSigningDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
17 actionable tasks: 17 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:validateSigningDebug'.
> Keystore file '/home/tawsif/react native/react-native-redux/android/app/debug.keystore' not found for signing config 'debug'.

* 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 4s
Run Code Online (Sandbox Code Playgroud)

rab*_*t87 36

问题是该版本正在寻找调试密钥库,但找不到它。

找不到用于签名配置“ debug”的密钥库文件“ / home / tawsif / react native / react-native-redux / android / app / debug.keystore”。

React Native GitHub中存在一个与相同问题有关的问题。根据页面上的内容,您可以通过创建调试密钥库来解决它。从线程引用:

您可以通过在android / app /目录中运行以下命令来生成调试密钥库:keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

链接到该问题:https : //github.com/facebook/react-native/issues/25629


Laz*_*ima 25

只需从官方模板https://raw.githubusercontent.com/facebook/react-native/master/template/android/app/debug.keystore下载

复制debug.keystore到您的android/app/.

前任: mv ~/Downloads/debug.keystore /Users/lazaro/apps/myapp/android/app/

参考:https : //github.com/facebook/react-native/issues/25629#issuecomment-513245590


Noo*_*der 7

基于@ rabbit87的答案,解决方案是在ProjectName/Andoid/app目录中运行以下命令 来解决问题

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
Run Code Online (Sandbox Code Playgroud)


rob*_*fox 5

我遇到了同样的错误,通过这个https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores解决了

cd ./android/app/

进而

keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000