Failed to resolve: com.android.support:appcompat-v7:27.+ android studio 2.3.3

-1

I use android studio 2.3.3

and every time I start a new project this error marks me

this is my granddle Module: App file

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.example.yahlopee.capteurs"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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:22.0.0'
    compile 'com.h2database:h2:1.4.186'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
}

and this is the build.gradle project

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()


    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I have already tried to add in allprojects maven, but even so it does not work, someone has some solution and I can not click the link that seems below the error

    
asked by Ernesto Emmanuel Yah Lopez 26.03.2018 в 14:51
source

2 answers

1

You are defining:

compileSdkVersion 27
buildToolsVersion "27.0.3"

and

targetSdkVersion 27

but you are using Android Studio 2.3.3, the maximum support for this version is for API level 26 , if it works with Android Studio 2.3.3, it would even mean changing the Gradle version of:

classpath 'com.android.tools.build:gradle:2.3.3'

a:

classpath 'com.android.tools.build:gradle:3.0.1'

I recommend you update to android 3.0.1 which is the stable version (March 2018), so you can use the API 27 without problem:

link

    
answered by 28.03.2018 / 01:02
source
0

Try adding the google repository

repositories {
    google()
    jcenter()
}

It is recommended that you do not use the% .+ , since an update of the module may no longer be compatible with your project. In the case of appcompat-v7 , the most current import is implementation 'com.android.support:appcompat-v7:27.1.0'

    
answered by 26.03.2018 в 18:20