繁体   English   中英

错误:在运行 React Native 项目时无法确定任务 ':app:compileDebugJavaWithJavac' 的依赖关系

[英]Error : Could not determine the dependencies of task ':app:compileDebugJavaWithJavac' while running React Native Project

尝试运行我的 React Native 项目时出现错误。

react-native run-android

错误看起来像

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'E:\IT tasks\android\ninja-react-native\android\local.properties'.

请帮我。

在 local.properties 文件中添加SDK (sdk.dir) 位置路径:

对于 windows 用户:

sdk.dir = C:\\Users"MyUserName"\\AppData\\Local\\Android\\Sdk

对于 Mac 用户:

sdk.dir = /Users/USERNAME/Library/Android/sdk

对于 Linux 用户:

sdk.dir = /home/USERNAME/Android/Sdk

将用户名替换为您的用户名。 并检查 sdk 的名称是否为 Sdk 或 sdk,替换为它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM