Jay's Developer Note

[Android] Error:Error:Failed to resolve: com.android.support:** Install Repository and sync project 본문

TroubleShooting

[Android] Error:Error:Failed to resolve: com.android.support:** Install Repository and sync project

Jay(J) 2017. 12. 6. 14:34
728x90

Error:Error:Failed to resolve: com.android.support:** Install Repository and sync project

발생원인
Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1 Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1 Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1 Install Repository and sync project 
Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1 Install Repository and sync project 
Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1 Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1 Install Repository and sync project

Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1 Install Repository and sync project     Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1 Install Repository and sync project     Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1 Install Repository and sync project     Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1 Install Repository and sync project     Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1 Install Repository and sync project     Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1 Install Repository and sync project

 

딱 보면 쟤네만 저 버전으로 업데이트해주거나 디펜던시 추가를 해주거나 하면 이슈가 해결될 듯 싶었으나!

완전 아니었다.

먼저 찾은 해결법은 여러 개다.

1. 앞서 말한대로 저 디펜던시를 추가 및 업데이트
2. SDK Manager 에 Tools 탭에 Android Support Repository 업데이트 혹은 언인스톨 후 재인스톨
3. complieSdkVersion, buildToolsVersion, targetSdkVersion 의 싱크 맞춰주기

 

허나 아무것도 해결을 도와주진 않았다..

 

그러던 중 stack overflow에 나와 같은 이슈로 무려 4시간 전에 그니까 오늘! 이슈 등록을 한 개발자가 있었고! 무려 1시간 전에! 해당 답변이 그것도 2개 씩이나! 달려 있는 것이 아닌가?

 

놀랍게도 해결이 되었다. 어메이징!

해결방법

프로젝트 단위의 그래들 파일의 allprojects 태그 안에 있는 repositories 태그 안에 maven 위치를 구글로 설정해 주는 것이었다.

즉 build.gradle(Project: project_name) 파일에

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

이렇게 추가하면 간단하게 해결이 되는 것이었다.

 

다른 답변도 있긴 했으나 그것은 내 경우에는 해결이 되지 않았다.

그 방법은 동일한 project 단위의 그래들 파일에

buildscript 태그와 allprojects 태그 안에 있는 repositories 태그 안에 google() 을 넣는 것이다.

 

근데 이렇게 설정하고 나니까

value-26.xml 이 또 에러를 뿜어내는 것이 아닌가!

그래서 컴파일버전 빌드툴버전 타겟버전을 모두 26으로 올려버렸다.

이상 뜬금없이 뿜어낸 에러 해결~

 

Ref : https://stackoverflow.com/questions/47664505/android-gradle-sync-issue

728x90