簡體   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