当前位置: 首页 > 知识库问答 >
问题:

错误命令失败:gradlew.bat app:installdebug

汪文光
2023-03-14

当我运行“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!

OS Windows 10节点:14.2.0 java:java版本“1.8.0_251”java(TM)SE运行时环境(build 1.8.0_251-B08)java HotSpot(TM)64位服务器VM(build 25.251-B08,混合模式)分级版本:5.1.1

JAVA_HOME、ANDROID_HOME和path添加到环境中

共有1个答案

曹高阳
2023-03-14

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

我今天遇到了这个问题。我的情况是,这个项目在Mac上运行得很好。然而,我需要让它在windows系统上运行。在我的Android\app\build.gradle文件中,我设置了一个getPassword方法,使我可以很容易地签署我的apk。在getPassword方法中,我调用了以下内容:

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

我注释掉了对getPassword方法的所有引用,它开始工作时没有出现任何问题。

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

 类似资料:
  • 当我运行tns run android时,我正在尝试构建一个nativescript应用程序。我遇到以下错误: 失败:生成失败,出现异常。 > 错误:任务执行失败:app:transformNativeLibsWithStripDebugSymbolForDebug。 启动进程“command”C:\Users\Natasha\AppData\Local\Android\Sdk\ndk bundl

  • 我是科尔多瓦的新手。我按照本教程创建了一个android项目。但我在MAC上面临以下错误: 错误:错误:命令“android”失败。确保已安装最新的Android SDK,并且“Android”命令(位于工具/文件夹内)已添加到您的路径中。 我反复更新了Android SDK,也编辑了PATH--- 导出路径=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

  • 我是科尔多瓦的新手,所以如果我的问题不相关,请原谅我。我的Windows7x64机器中有一个cordova项目。昨天,我通过构建了我的cordova应用程序。但是我需要添加新的插件来更新我的cordova项目。我做了什么来添加这个插件到我的cordova应用程序; null 构建失败C:\android\sdk\tools\ant\BUILD.xml:720:执行这一行时发生以下错误:C:\and

  • 问题内容: 我是科尔多瓦的新手,所以如果我的问题不相关,请原谅我。我在Windows 7 x64计算机上有一个cordova项目。昨天,我通过构建了Cordova应用。但是我需要添加新的插件来更新我的cordova项目。我将该插件添加到我的cordova应用程序中所做的工作; 我在win7 x64 env上安装了git应用程序。 我在cmd上写了这个命令。 我打开Windows环境变量/路径窗口并

  • 我正在尝试从网站向邮件id发送反馈,但收到以下错误: 2017-12-03 12:03:48无法访问文件: /var/tmp/file.tar.gz2017-12-03 12:03:48无法访问文件: /tmp/image.jpg2017-12-03 12:03:48服务器- 这是我的代码:

  • 当我尝试在本地安装vue store front时,但当我尝试“Thread install”命令时,我出现以下错误。如何解决此错误?如何解决此错误?