React native Error:Project:app声明从配置'compile'到配置'default'的依赖项... project:react-native-linear-gradient

时间:2017-06-16 14:31:51

标签: android react-native dependency-management

我正在尝试在instructions之后将react-native-linear-gradient添加到我的项目中,但在将依赖项添加到app/build.gradle文件并尝试同步项目后,我收到此错误

Error:Project :app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :react-native-linear-gradient.

可能有人有任何想法我做错了什么?感谢。

更新

这是我的app/build.gradle文件

dependencies {
    compile project(':react-native-svg')
    compile project(':react-native-linear-gradient')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

这是我的settings.gradle文件:

rootProject.name = 'DuluxTradePoints'
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':app'

0 个答案:

没有答案