Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding support libraries v7, v13 with gradle is not working

Tags:

android

gradle

I'm trying to import both android support libraries. I'm trying to implent GoogleMaps AP2 into my Android Application. Therefore I need both libraries. I'm using AndroidStudio and Gradle.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile 'com.android.support:appcompat-v7:21.0.+'
    // compile 'com.google.android.gms:play-services:6.1.+'
    compile "com.android.support:support-v13:18.0.+"
    compile "com.loopj.android:android-async-http:1.4.5"
    repositories {
        mavenCentral()
    }
    compile "com.github.chrisbanes.actionbarpulltorefresh:library:+"
    compile 'joda-time:joda-time:2.5'
}

The error is:

Module version com.android.support:support-v13:18.0.0 depends on libraries but is not a library itself
like image 581
So S Avatar asked Nov 04 '14 16:11

So S


2 Answers

You have to use the latest version of support-v13:21.0.+

You have this error because both appcompat and support-v13 depends on support-v4 and their is a version conflict.

Not the best error by the way.

like image 127
pdegand59 Avatar answered Oct 24 '22 05:10

pdegand59


Finally this code is working for me in:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile 'com.android.support:support-v4:20.0.+'
    compile "com.android.support:appcompat-v7:20.0.+"
    compile "com.android.support:support-v13:20.0.+"
    compile 'com.google.android.gms:play-services:6.1.+'
    compile "com.loopj.android:android-async-http:1.4.5"
    repositories {
        mavenCentral()
    }
    compile "com.github.chrisbanes.actionbarpulltorefresh:library:+"
    compile 'joda-time:joda-time:2.5'
}
like image 40
So S Avatar answered Oct 24 '22 05:10

So S