【发布时间】:2016-06-05 12:48:52
【问题描述】:
我有一个库项目,库项目中的第三个依赖项:
库构建.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.facebook.fresco:fresco:0.9.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.satyan:sugar:1.4'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.jakewharton.timber:timber:4.1.1'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
}
应用构建.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile project(':library')
debugCompile project(path: ':library', configuration: 'debug')
releaseCompile project(path: ':library', configuration: 'release')
}
现在我遇到了一个问题,我无法在库中使用依赖类。它无法识别这些库。
但是当我将依赖项放入应用程序 build.grandle 时。这个问题消失了。 那么有人可以帮助我吗?有什么问题。
谢谢!
【问题讨论】:
-
尝试在您的
settings.gradle文件中添加include ':library',假设您还没有它。 -
@leeo 你把问题卖了吗?我也遇到过这种情况
-
我也有类似的问题。我的 2 个依赖库中有 jar 文件,它们被主应用程序忽略。
标签: android dependencies android-studio-2.2