执行任务':app:compileDebugJavaWithJavac'的反应失败 [英] Execution failed for task ':app:compileDebugJavaWithJavac' react native

查看:235
本文介绍了执行任务':app:compileDebugJavaWithJavac'的反应失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在cmd中像这样在我的android设备上运行react native应用

I am trying to run react native app on my android device like this in cmd

cd C:\Users\User\Desktop\js

react-native run-android

失败:构建失败,并出现异常.

FAILURE: Build failed with an exception.

  • 出了什么问题:任务':app:compileDebugJavaWithJavac'的执行失败.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

找不到tools.jar

Could not find tools.jar

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    建立失败

    总时间:5.243秒无法在设备上安装应用程序,请阅读有关详细信息,请参见上面的错误.确保您有一个Android模拟器正在运行或已连接设备并已设置您的Android开发环境: https://facebook.github.io/react-native/docs/android-setup.html

    Total time: 5.243 secs 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/android-setup.html

    有人可以告诉我如何解决此问题吗?

    Can anyone please tell me how to fix this problem?

    推荐答案

    使用以下步骤一次,可能会对您有所帮助:

    Use the following step once, it may help you:

    第1步:通过管理员打开cmd

    step 1: open cmd through administrator

    第2步:通过 cd<您项目的路径>

    步骤3:运行以下命令: ./gradlew clean

    第4步: react-native run-android

    step 4: react-native run-android

    这篇关于执行任务':app:compileDebugJavaWithJavac'的反应失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆