본문 바로가기

안드로이드/오류

[오류] Firebase SDK 동기화 오류

Firebase와 안드로이드 연결 셋팅 중 안드로이드에서 Gradle 추가하는 과정에서 다음과 같은 오류가 났다.

 

Unable to find method ''com.android.build.api.variant.SourceDirectories$Flat com.android.build.api.variant.Sources.getByName(java.lang.String)'' 'com.android.build.api.variant.SourceDirectories$Flat

com.android.build.api.variant.Sources.getByName(java.lang.String)' Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

 

사실 Firebase에서 하라는대로 했기 때문에 원인을 찾을 수 없어 이것 저것 찾아보는 와중에 안드로이드 스튜디오 버전 업데이트를 해보라는 글을 보았다.

 

재설치하여 버전을 업그레이드 해보았지만 그대로..

 

Gradle Plugin 버전 차이 문제일 수도 있기 때문에 AGP ( Android Gradle Plugin)을 업데이트하였더니 문제가 해결되었다.

 

1. Android Studio Update

2. AGP Update