Android

[Android] Firebase gradle sync failed 오류 해결, 안드로이드 오프라인 모드로 사용하기

haehyun 2022. 3. 3. 12:22

문제 상황

Firebase 연동을 위해서 https://console.firebase.google.com/ 사이트에서 'Android 앱에 Firebase 추가' 과정을 따라하고 있었다. 3번째 단계인 'Firebase SDK 추가'에서 프로젝트, 모듈 단위 Gradle 파일을 수정 후 'Sync Now'를 클릭했으나, 동기화가 실패하며 아래와 같은 로그가 뜬다.

Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.
> Could not resolve all artifacts for configuragion ':classpath'.
  >Could not resolve com.google.gms:google-services:4.3.10.
	Required by:
	project :
	No cached version of com.google.gms:google-services:4.3.10 available for offline mode.
	No cached version of com.google.gms:google-services:4.3.10 available for offline mode.

Possible solution:
  - Disable offline mode and rerun the build

 

Firebase 연동을 위해 google-services 라이브러리를 가져와야 하는데, 오프라인 모드에서 사용할 수 있는 버전이 없다고 뜬다.

 

해결

로그에서 친절하게 해결법을 알려주고 있다. Possible solution에 적힌대로 오프라인 모드를 끄고 다시 빌드해보자.

안드로이드 오프라인 모드 끄기

1. [Gradle] 클릭 > [Toggle Offline Mode] 아이콘 클릭

2. [Try Again] 클릭.

 

3. 동기화 완료