无法确定任务“:app:mergeDebugAssets”的依赖关系
Could not determine the dependencies of task ':app:mergeDebugAssets'
当我在我的项目中 运行 react-native 运行-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)
转到您的项目级别 android 目录和 运行 ./gradlew clean
如果问题仍然存在,请删除 node_modules 文件夹和 npm install
或者您可以手动执行此操作:
npm list
然后解决所有 UNMET DEPENDENCY
个问题
第 1 步:检查您的“SDK 平台”和“SDK 工具” 是否已安装和更新
第二步:在android文件夹中创建“local.properties”文件并粘贴以下内容
sdk.dir = /Users/USERNAME/Library/Android/sdk
这应该可以解决您的问题
当我在我的项目中 运行 react-native 运行-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)
转到您的项目级别 android 目录和 运行 ./gradlew clean
如果问题仍然存在,请删除 node_modules 文件夹和 npm install
或者您可以手动执行此操作:
npm list
然后解决所有 UNMET DEPENDENCY
个问题
第 1 步:检查您的“SDK 平台”和“SDK 工具” 是否已安装和更新
第二步:在android文件夹中创建“local.properties”文件并粘贴以下内容
sdk.dir = /Users/USERNAME/Library/Android/sdk
这应该可以解决您的问题