Cant find 'com.android.support:design:22.2.0'

I want to use FloatingActionButton

, but for this I need a library:

compile 'com.android.support:design:22.2.0'

      

But when I add it to my gradle I get the message:

A problem occurred configuring project ':myModule'.
Could not resolve all dependencies for configuration ':myModule:_debugCompile'.
   Could not find com.android.support:design:22.2.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/design/22.2.0/design-22.2.0.pom
         https://jcenter.bintray.com/com/android/support/design/22.2.0/design-22.2.0.jar
         file:/D:/Development/Android/sdk/extras/android/m2repository/com/android/support/design/22.2.0/design-22.2.0.pom
         file:/D:/Development/Android/sdk/extras/android/m2repository/com/android/support/design/22.2.0/design-22.2.0.jar
         file:/D:/Development/Android/sdk/extras/google/m2repository/com/android/support/design/22.2.0/design-22.2.0.pom
         file:/D:/Development/Android/sdk/extras/google/m2repository/com/android/support/design/22.2.0/design-22.2.0.jar
     Required by:
         myProject:myModule:unspecified

      

I tried updating my Android SDK, but everything is updated:

enter image description here

So why can't it be allowed com.android.support:design:22.2.0

?

This is my gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "de.bla.myProject"
        minSdkVersion 19
        targetSdkVersion 22
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

    buildTypes {
        debug {
            debuggable true
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':androidcircularcrop_lib')
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:design:22.2.0'
    compile files('libs/eventbus-3.0.0-beta1.jar')
    compile files('libs/mpandroidchartlibrary-2-1-0.jar')
    compile files('libs/picasso-2.4.0.jar')
    compile files('libs/YouTubeAndroidPlayerApi.jar')
}

      

+3


source to share


1 answer


Looking at your build file, always target and compile sdk to the same number. Appcompat lib is also part of sdk, so when you use 22.xx lib support, you need at least 22 sdk for compatibility, let alone lib lookup. Also as suggested by Arkady it is recommended to use the latest builds and gradle version compatible with your android studio.



+2


source







All Articles