-1

When creating the first project.

Tell me please. How to solve this problem?

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
and73
  • 1
  • 2

3 Answers3

0

open SDK manager and install repository of version 27 then it will work either you can check which API level install properly you can change into the gradle like this :

android {
    compileSdkVersion 27
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:0.5'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.android.support:design:27.0.1'
}

to this if you have API level 26 :=

android {
    compileSdkVersion 26
    defaultConfig {
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:0.5'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.android.support:design:26.0.1'
}

you can change like this then your problem will solved.

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
0

Just click on "install repository and sync project" in your error. It will install the required repository and solve your problem.

Pang
  • 9,564
  • 146
  • 81
  • 122
Asif Ghanchi
  • 236
  • 3
  • 11
0

Thanks to all my colleagues. Button "Install repository and synchronize project" does not work. 27 version is already installed.

enter image description here

I changed the 27 version to 25 and the error disappeared.

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
and73
  • 1
  • 2