Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guy's
i install android studio 3.1.1 and create new project ... but project sync failed any time ! android studio gradle is 4.4

this gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "ir.rahgoshafan.exampleapp"
        minSdkVersion 17
        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'
        }
    }
    buildToolsVersion '27.0.3'

    buildscript {
        repositories {
            jcenter()
            google()
            maven { url 'http://repo1.maven.org/maven2' }
            maven { url 'http://jcenter.bintray.com' }
            maven { url "https://maven.google.com" }
            maven { url "https://jitpack.io" }
        }
        dependencies { classpath 'com.android.tools.build:gradle:3.1.0' }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-vector-drawable:27.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}


this error:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:design:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:support-vector-drawable:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-core:3.0.1.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:design:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:support-vector-drawable:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:design:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:support-vector-drawable:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve junit:junit:4.12.
Open File
Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:design:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:support-vector-drawable:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:design:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:support-vector-drawable:27.0.2.
Open File
Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve junit:junit:4.12.
Open File
Show Details


What I have tried:

i change appcompat to

implementation 'com.android.support:appcompat-v7:27.0.3'


but send similar error
Posted
Updated 9-Sep-18 6:41am
Comments
David Crow 23-Apr-18 8:41am    
Have you tried changing it to:

implementation 'com.android.support:appcompat-v7:27.+'
Kim Gabinete 2-Aug-18 9:38am    
hello.. how to do that appcompat? i'm new in using android studio and i'm encountering same error.

1 solution

open the app.
go to gradle scripts.
then build.gradle(module:app)
finally inside dependecies type ( implementation 'com.android.support:appcompat-v7:27.+'
)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900