【问题标题】:How to fix "Support-v13:19.1.0 depends on libraries but is not a library itself"?如何修复“Support-v13:19.1.0 依赖于库但不是库本身”?
【发布时间】:2014-08-27 22:21:25
【问题描述】:

我刚刚在 Android Studio 0.8.1 中启动了一个项目,这是自 0.6.2 升级以来的第一次。

抛出的错误是“错误:模块版本 com.android.support:support-v13:19.1.0 依赖于库但不是库本身”。

有人知道这是为什么吗?我已经安装了一些新的 API20 东西来玩 Android L,但是这个项目的 buildTools 仍然设置为 19.1.0。

这是我的 build.gradle 的依赖部分:

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   compile 'com.android.support:appcompat-v7:19.1.+'
   compile 'com.android.support:support-v13:19.1.+'
   compile 'com.jakewharton:butterknife:5.1.0'
   compile 'de.greenrobot:eventbus:2.2.1'
   compile 'com.google.code.gson:gson:2.2.4'
   compile 'com.mcxiaoke.viewpagerindicator:library:2.4.1'
   compile 'uk.co.chrisjenx:calligraphy:0.7.+'
   compile 'com.crashlytics.android:crashlytics:1.+'
   compile 'com.google.android.gms:play-services:4.4.+'
}

SDK/Buildtools 设置如下:

compileSdkVersion 19
buildToolsVersion "19.1.0"

谁能解释一下或指出我的解决方法?我被难住了。

【问题讨论】:

    标签: android gradle android-support-library android-gradle-plugin


    【解决方案1】:

    看起来support-v13:19.1.0 的元数据可能不正确。尝试切换到

    compile 'com.android.support:support-v13:20.0.0' 看看您的问题是否仍然存在?

    【讨论】:

    • 我在添加 com.google.android.gms:play-services-plus 依赖后开始出现错误,这对我也有用。
    • 困扰我的是这行得通,但我不知道为什么。我觉得我不得不无缘无故地改变我的依赖关系。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-25
    • 2012-05-08
    • 1970-01-01
    相关资源
    最近更新 更多