Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android studio 2.2预览应用程序无法识别库依赖项_Android_Dependencies_Android Studio 2.2 - Fatal编程技术网

android studio 2.2预览应用程序无法识别库依赖项

android studio 2.2预览应用程序无法识别库依赖项,android,dependencies,android-studio-2.2,Android,Dependencies,Android Studio 2.2,我有一个库项目,库项目中的第三个依赖项: 图书馆建筑.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'

我有一个库项目,库项目中的第三个依赖项:

图书馆建筑.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'
}
dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')

  //compile project(':library')
  debugCompile project(path: ':library', configuration: 'debug')
  releaseCompile project(path: ':library', configuration: 'release')
}
应用程序build.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'
}
dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')

  //compile project(':library')
  debugCompile project(path: ':library', configuration: 'debug')
  releaseCompile project(path: ':library', configuration: 'release')
}
现在我遇到了一个问题,我不能在库中使用dependencies类。它可能无法识别这些库

但当我将依赖项添加到app build.grandle时。这个问题消失了。 有人能帮我吗?有什么问题吗


谢谢

这可能是gradle try将其设置为true的可传递依赖项的问题

在app build.gradle文件中

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')

  //compile project(':library')
  debugCompile project(path: ':library', configuration: 'debug'){transitive = true}
  releaseCompile project(path: ':library', configuration: 'release'){transitive = true}
}

只是一个完全不确定的猜测,但值得一试。

这可能是gradle try将其设置为true的可传递依赖项的问题

在app build.gradle文件中

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')

  //compile project(':library')
  debugCompile project(path: ':library', configuration: 'debug'){transitive = true}
  releaseCompile project(path: ':library', configuration: 'release'){transitive = true}
}

只是一个完全不确定的猜测,但值得一试。

尝试在
设置.gradle
文件中添加
包含:library'
,假设您还没有它。@leeo您已经解决了这个问题吗?我遇到过萨米人,我也有类似的问题。“我的依赖项库”中有2个jar文件被主应用程序忽略。请尝试在
settings.gradle
文件中添加
include'
,假设您还没有。@leeo您解决了这个问题吗?我遇到过萨米人,我也有类似的问题。我的2个依赖项库中有jar文件,主应用程序会忽略这些文件。