2017-11-14 6 views
1

모든 해결책을 시도했지만 해결되지 않았습니다. (. 살이 Gradle을은 "오프라인으로 작업", .gradle 삭제 된 파일을 무효화하고 다시 시작하는 나는 또한 완전히 JDK - 안드로이드 스튜디오를 제거하고 다시 설치.) 여기 Gradle Project Sync가 실패했습니다. Android Studio 3.0 (JDK 9.0.1)

문제의 스크린 샷입니다 : 안드로이드 스튜디오 3.0 Gradle을 동기화 문제 내가 빌드 도구와 SDK 버전 (23) 또는 (24) 0123을 추가 할 생각

+0

시스템의 종류는 64 또는 32 비트입니까? –

+0

64 비트 창 10 개 집. –

+0

jCenter() 및 google inyour 프로젝트 수준 build.gradle 파일 –

답변

0

: 여기

enter image description here 내 자바 버전 시스템/로그 파일 enter image description here

here입니다하고 23 빌드 도구 및 SDK 버전을 사용하도록 선택하는 경우,이

컴파일 'com.android.support:appcompat-v7:23.1.1'

주 같은 종속성을 추가 : 그 (26)를 기록 어디든지 , 당신이 23 공구와 SDK 버전 을 빌드하도록 선택한 경우에만 23으로 대체하십시오. 여전히 문제가 있으면 요청할 수 있습니다.

+0

나는이 물건의 초보자 같다 :) 나를 위해 더 간단한 설명을 할 수 있니? (이것과 당신의 다른 코멘트) –

+0

좋아, 내가 자세히 대답 할 것입니다 –

0

당신은 안드로이드 스튜디오에서 build.gradle 파일을 열 수는 다음의 스크린 샷을 공유하시기 바랍니다 수 compileSdkVersion, 당신이 그것을 이해하지 않은 경우이

android { 
compileSdkVersion 23 
buildToolsVersion "24.0.1" 
.... 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.1.1' 

}

같은 buildToolsVersion 종속성을 변경하려면 build.gradle 파일? Gradle을 스크립트에서, 안드로이드 스튜디오의 왼쪽에 -> build.gradle (Modual : 응용 프로그램)

+0

그냥 여기에 "CompileSdkVersion"입니다. 다른 용어는 존재하지 않습니다. Github : https://github.com/Hacklesss/logs/blob/master/build.gradle1 및 SS : https://i.imgur.com/Si59ETN.png –

0

가 이런 식으로

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
defaultConfig { 
    applicationId "com.example.hackl.happybirthday" 
    minSdkVersion 15 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 
dependencies { 
implementation fileTree(dir: 'libs', include: ['*.jar']) 
implementation 'com.android.support:appcompat-v7:23.1.1' 
implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
testCompile 'junit:junit:4.12' 
androidTestImplementation 'com.android.support.test:runner:1.0.1' 
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'} 

를 수행하고 지금 동기화를 클릭합니다 (이 때 자동으로 표시됩니다 이 파일을 변경하십시오.

+0

다음은 https : // i입니다. imgur.com/ssNTY01.png –

+0

아무 일도 없었습니다. 여전히 오류. –

+0

이 줄 testImplementation에서 대신 testImplementation의 testCompile 시도 '의 JUnit : JUnit을 : 4.12' 에 testCompile '의 JUnit : JUnit을을 : 4.12' –

0
Take these easy steps as per developer.android.com 
first add these lines on build.gradle file 

buildscript { 
    repositories { 
      jcenter() 
     // You need to add the following repository to download the 
     // new plugin. 
     google() 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0' 
    } 
} 


after that 
update Gradle manually, edit the URL in gradle-wrapper.properties to the following: 
distributionUrl=\ 
    https\://services.gradle.org/distributions/gradle-4.1-all.zip 


For your reference you can check the below link 
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html 
+0

변경된 사항이 없습니다. 여전히 gradle 동기화 오류가 발생했습니다. –

0

Android Studio를 완전히 제거하고 3 번 다시 설치하십시오. 모든 단계에서 Gradle Sync 오류 메시지를 클릭하고 누락 된 파일을 모두 설치했습니다. 3 번 설치가 누락 된 파일을 올바르게 설치하면 gradle sync 문제를 제거하는 데 성공했습니다. 어떻게 그리고 왜 성공적으로 1, 2 번 설치가되었는지 알 수 없습니다. 어쨌든, 끝났어.

참고 : 이전에는 모든 답을 시도했습니다. 고마워.

Succeeded