jithendra sai
jithendra sai

Reputation: 73

Error:(42, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.1

I tried changing SDK version and everything, but no luck seems to be like error wants to stay.

when app: Compact is 25.0.1 it says to change to a newer version and I tried changing it occurs with a new error.

And the newer version of app: compact V7 26.0.1

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.jithendra.kotlinexample"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
 }
    }

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}
      }

buildscript {
ext.kotlin_version = '1.1.4'
repositories {
jcenter()
    mavenCentral()
}
dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}

 dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.jetbrains.anko:anko-commons:0.10.0"
compile (//Anko dependencies
        'org.jetbrains.anko:anko-sdk15:0.8.3', //sdk19,21,23 are also available
        'org.jetbrains.anko:anko-appcompat-v7:0.8.3' //for appcompact-v7 bindings
)

}
repositories {
mavenCentral()
 }

click on this link for error

Upvotes: 1

Views: 617

Answers (1)

user8466383
user8466383

Reputation:

Here Android studio asks maven library dependency. Just open your project level gradle and add following inside:

allprojects{
    repositories { } 
}

part (in case you don't have create one as above):

maven {
    url "https://maven.google.com"
}

Upvotes: 4

Related Questions