gpt4 book ai didi

react-native - 错误命令失败 : gradlew. bat app:installDebug

转载 作者:行者123 更新时间:2023-12-03 03:54:41 70 4
gpt4 key购买 nike

当我运行“react-native run-android”或“npx react-native run-android”或“cd andriod ./gradlew clean”这些命令时,错误显示

PS D:\work\Myproject-app> npx react-native run-android
    info Starting JS server...
Starting a Gradle Daemon, 2 incompatible and 2 stopped Daemons could not be reused, use --status for details

> Configure project :app
Reading env from: .env

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred evaluating project ':app'.
> A problem occurred starting process 'command 'security''

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> compileSdkVersion is not specified.

* 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 19s
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

我也尝试使用最新版本的 Gradle!

操作系统 Windows 10
节点:14.2.0
Java:Java 版本“1.8.0_251”
Java(TM) SE 运行时环境(构建 1.8.0_251-b08)
Java HotSpot(TM) 64 位服务器 VM(构建 25.251-b08,混合模式)
Gradle 版本:5.1.1

JAVA_HOME、ANDROID_HOME 以及添加到环境中的路径

最佳答案

我没有足够的代表发表评论,但是......

我今天遇到了这个问题。我的情况是该项目在 Mac 上运行良好。但是,我需要让它在 Windows 系统上运行。在我的 android\app\build.gradle 文件中,我设置了一个 getPassword 方法,它可以让我轻松签署我的 apk。在 getPassword 方法中,我有这个调用:

commandLine 'security', '-q', 'find-generic-password', '-a', currentUser, '-s', keyChain, '-w'

我注释掉了所有对 getPassword 方法的引用,它开始正常工作。

问题的根源在于mac使用的“安全”命令行工具在windows上不可用。由于我现在还需要使用 Windows 框,因此我在外部凭据文件中配置了密码。

关于react-native - 错误命令失败 : gradlew. bat app:installDebug,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61892089/

70 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com