我正在尝试在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'