1

I am trying to add the following support libraries to my buid.gradle:

 buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }
}

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

android {
    useLibrary 'org.apache.http.legacy'

    compileSdkVersion 26
    buildToolsVersion "23.0.3"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 26

    }

    signingConfigs {
        release {

        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
}

repositories {
    jcenter()
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.android.support:support-v7:26.0.0'
    compile 'com.android.support:appcompat-v7:26.0.0'
    compile 'com.android.support:cardview-v7:26.0.0'
    compile 'com.melnykov:floatingactionbutton:1.1.0'
    compile 'it.sephiroth.android.library.imagezoom:imagezoom:1.0.5'
    //Apptentive
    compile 'com.apptentive:apptentive-android:2.1.3@aar'
    //compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.0.0'

}

I am receiving errors stating that each library "Failed to Resolve" followed by each line of code from above. I was hoping to remain current with the latest support libraries for regular support, appcompat, and cardview.

tccpg288
  • 3,242
  • 5
  • 35
  • 80

2 Answers2

9

To use support libraries starting from version 26.0.0 you need to add Google's Maven repository to your project's build.gradle file as described here.

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
Shonubi Korede
  • 541
  • 6
  • 4
1

What is your buildToolsVersion and compileSdkVersion?

android {
    buildToolsVersion "26.0.1"
}

Maybe try updating that in AndroidManifest.xml? Sometimes they arent compatible and you will have to modify the versions accordingly.

This link might help :Setting up Gradle for api 26 (Android)

Matthew Shearer
  • 2,715
  • 3
  • 23
  • 32