簡體   English   中英

無法確定任務 ':app:mergeDebugAssets' 的依賴關系

[英]Could not determine the dependencies of task ':app:mergeDebugAssets'

當我在我的項目上運行 react-native run-android 時,我收到 gradle 的構建錯誤。 我已經用 npm uninstall --save react-native-ftp 卸載了 react-native-ftp,刪除了 node_modules 的依賴,清除了./gradle 緩存文件。 但是錯誤連續..

在我的環境 windows 這個項目工作正常。

發生了什么事?

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :react-native-ftp.
     Required by:
         project :app
      > Unable to find a matching configuration of project :react-native-ftp:
          - None of the consumable configurations have attributes.

* 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 2s

    at makeError (/home/leroto/leroto-workspace/svm/frontend/node_modules/execa/index.js:174:9)
    at /home/leroto/leroto-workspace/svm/frontend/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (/home/leroto/leroto-workspace/svm/frontend/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (/home/leroto/leroto-workspace/svm/frontend/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:186:9)

Go to your project level android directory and run ./gradlew clean If the problem persists, delete node_modules folder and npm install or you can do this manually: npm list and then resolve all UNMET DEPENDENCY issues

步驟1:檢查您所有的“ SDK Platforms ”和“ SDK Tools”是否已安裝並更新”

Step2:在android文件夾中創建“ local.properties ”文件並粘貼以下內容

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

這應該可以解決您的問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM