应用程序声明了从配置“编译"到配置“默认"的依赖关系,该依赖关系未在项目的描述符中声明 [英] app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project

查看:530
本文介绍了应用程序声明了从配置“编译"到配置“默认"的依赖关系,该依赖关系未在项目的描述符中声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的项目中导入一个名为"wear"的库模块,在构建时,我得到了这个信息:

I am importing a library module named "wear" in my project and while building, I am getting this:

Error : A problem occurred configuring project ':app'.   
Could not resolve all dependencies for configuration ':app:_debugApk'.   
Project :app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :wear.

是什么意思?我该如何摆脱呢?

What does it mean? How can I get rid of this?

推荐答案

当Gradle无法找到特定组件时,通常会发生此错误.尝试使用Salesforce React Native Android示例时,我遇到了这种情况.

This error usually occurs when Gradle cannot find a particular component. I experienced this when trying to use the Salesforce React Native Android example.

您收到的错误消息看起来像您发布的错误消息……在我的情况下是

The error message you get looks like the one you posted ... in my case it was

Project :app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :libs:SalesforceReact.

我在项目android目录中找到了我的Gradle设置文件(称为settings.gradle).它的开始看起来像这样

I found my Gradle settings file ( called settings.gradle ) in the projects android directory. The start of it looked like this

rootProject.name = 'SmartSyncExplorerReactNative'

def libsRootDir = new File( settingsDir, '../node_modules/SalesforceMobileSDK-Android/libs' )
include ':app'

include ':libs:SalesforceReact'
project( ':libs:SalesforceReact' ).projectDir = new File( libsRootDir, 'SalesforceReact' )

在这种情况下,libsRootDir中给出的路径不存在(因为这些库实际上来自我克隆的另一个存储库,然后将此路径指向!).

In this case, the path given in libsRootDir did not exist (as these libraries actually came from a different repository which I cloned and then pointed this path to!).

一旦我更正了路径,保存了设置文件并重新运行,一切都会顺利进行.

Once I had corrected the path, save the settings file and reran, everything worked smoothly.

我希望这会有所帮助, 乔纳森.

I hope this helps, Jonathan.

这篇关于应用程序声明了从配置“编译"到配置“默认"的依赖关系,该依赖关系未在项目的描述符中声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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