问题描述
我在我的项目中导入了一个名为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.
这篇关于应用程序声明了从配置“编译"到配置“默认"的依赖项,该依赖项未在项目的描述符中声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!