본문 바로가기

개발자/Android

Build errors after Android Studio 3.2.1 upgrade 에러 - com.android.tools.build:aapt2:3.2.1


아래와 같은 컴파일 에러가 날때 참고하시길.

Build errors after Android Studio 3.2.1 upgrade 에러

검색에러명 - com.android.tools.build:aapt2:3.2.1-4818971

Could not find com.android.tools.build:aapt2:3.2.1-4818971**. Searched in the following locations:

    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-windows.jar    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-windows.jar    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom    file:/C:/Users/sandeepk2/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-windows.jar

    https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.pom

    https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971-windows.jar Required by:

    project :app 

왼쪽 탭에서 프로젝트 보이는 리스트에서 build.gradle 파일을 찾아서 아래와 같이 수정해주면 에러 없이 잘 된다. ㅠ.ㅠ

Just add google() in root level build.gradle

1
2
3
4
5
6
7
8
9
10
11
12
13
buildscript {
    repositories {
        google()   //  <--here
        jcenter()
    }
 }
 
allprojects {
    repositories {
        google()   //  <-- here
        jcenter()
    }
}


위에 google() 을 확인한다. 마술처럼 에러는 사라진다. ^^

참고주소 : https://stackoverflow.com/questions/52790020/build-errors-after-android-studio-3-2-1-upgrade