39

我正在使用带有Crouton库的 Android Studio 0.6.1,今天在 gradle 同步后出现下一个错误:

Error:A problem occurred configuring root project 'project_name'.
Module version de.keyboardsurfer.android.widget:crouton:1.8.4 depends on libraries but is not a library itself

这是怎么回事?

4

2 回答 2

62

这个问题是由于 com.android.support-v4 最近更新造成的。

所以我改变了

compile 'com.android.support:support-v4:20.+'

compile 'com.android.support:support-v4:19.1.+'

和油炸面包块工作正常

不同的解决方法是使用@aar:

compile('de.keyboardsurfer.android.widget:crouton:1.8.4@aar') {
    exclude group: 'com.google.android', module: 'support-v4'
}
于 2014-06-28T16:38:21.453 回答
7

我的解决方案根据@Revedko 的回答,使用@aar 并将所有支持更改为低于 21 -> 20 的版本。+

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.loopj.android:android-async-http:1.+'
    compile "com.bugsense.trace:bugsense:3.5"
    compile('de.keyboardsurfer.android.widget:crouton:1.8.4@aar') {
        exclude group: 'com.google.android', module: 'support-v4'
    }
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.google.android.gms:play-services:5.0.77'
}
于 2014-07-04T19:56:43.220 回答