Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle shows error for Support Library: "Module version com.android.support:support-v13:19.0.1 depends on libraries but is not a library itself"

This is what my build.gradle says:

apply plugin: 'android'
apply plugin: 'crashlytics'
apply from : '../gradle/checkstyle.gradle'
apply from : '../gradle/pmd.gradle'

compileSdkVersion 19
buildToolsVersion "19.0.3"

defaultConfig {
    minSdkVersion 17
    targetSdkVersion 19
}

But I see this compilation error:

Gradle 'mobi-client-connect-android-mobile' project refresh failed:
       Module version com.android.support:support-v13:19.0.1 depends on libraries but is not a library itself
like image 691
Nishant Soni Avatar asked Jul 01 '14 21:07

Nishant Soni


2 Answers

If you have just upgraded to Android Studio 0.8.x, Update all support library version numbers to match your build tools.

dependencies {
    compile 'com.android.support:support-v13:19.1.+'
    ...
}

you likely want to update the build tools version

buildToolsVersion "19.1.0"

Crappy error message :-( This update has been a pain!

like image 135
Ben Neill Avatar answered Oct 05 '22 11:10

Ben Neill


I dont know how this worked!

Original Gradle :

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'
    defaultConfig {
        applicationId 'org.ieeekjsieit.app'
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v13:19.+'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.nineoldandroids:library:2.4.+'
}

I just changed the it to:

New Gradle :

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'
    defaultConfig {
        applicationId 'org.ieeekjsieit.app'
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v13:19.+'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.nineoldandroids:library:2.4.+'
}

As you can see, I forced the appcompat-v7 to use a specific version of 19.+ and not the latest!

Before changing I had this error :

Gradle 'org.ieeekjsieit.app' project refresh failed:
       Module version com.android.support:support-v13:19.1.0 depends on libraries but is not a library itself
like image 38
August Avatar answered Oct 05 '22 13:10

August