我是全新的反应-本土的和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
发布于 2019-07-19 01:37:47
问题是,构建正在寻找调试密钥存储库,但找不到它。
无法找到用于签名配置“调试”的Keystore文件
/home/tawsif/react native/react-native-redux/android/app/debug.keystore
。
在本机GitHub的反应中也存在同样的问题。根据页面,您可以通过创建调试密钥存储库来解决这个问题。引用线程的话:
可以通过在
android/app/
目录:keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
中运行以下命令来生成调试密钥存储库
发布于 2019-09-16 18:00:20
只需从官方模板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
发布于 2019-07-19 13:35:54
基于@rabbit87的答案,解决方案是在ProjectName/Andoid/app
目录中运行以下命令解决这个问题
keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
https://stackoverflow.com/questions/57104357
复制相似问题