File - Settings - Experimental 에 가서 Do not build Gradle task list during Gradle sync 체크박스를 해제하고
File - Sync Project with Gradle Files 를 한번 실행시켜 주면 됩니다.
3. signingReport 더블클릭하면 하단 콘솔에 SHA-1 값을 확인하실 수 있습니다.
5. google-services.json 다운로드
"google-service.json"파일은 안드로이드 프로젝트가 Firebase에 접근하기 위해서 필요합니다. 이 파일은 Firebase에서 발급하는 증명서로 이 안에는 Firebase에 필요한 여러 API 키가 담겨있습니다.
다운로드 받은 "google-service.json"파일을 다음과 같이 안드로이드 앱 모듈 루투 디렉터리에 넣어주시면 됩니다.
6. Firebase SDK 추가하기
프로젝트와 모듈단위의 gradle 파일에 구글 플러그인을 buildscript 종속성으로 추가합니다.
build.gradle(Project.appname)
buildscript {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
dependencies {
...
// Add the dependency for the Google services Gradle plugin
classpath 'com.google.gms:google-services:4.3.14'
}
}
allprojects {
...
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
build.gradle(Module.app)
plugins {
id 'com.android.application'
// Add the Google services Gradle plugin
id 'com.google.gms.google-services'
...
}
....
....
....
dependencies {
// ...
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:31.1.1')
// When using the BoM, you don't specify versions in Firebase library dependencies
// Add the dependency for the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics'
// TODO: Add the dependencies for any other Firebase products you want to use
// See https://firebase.google.com/docs/android/setup#available-libraries
// For example, add the dependencies for Firebase Authentication and Cloud Firestore
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
}
[TIP]
여기서 전 Arctic Fox버전이기 때문에 build.gradle(Project.appname) 파일에 위 코드를 넣을 수가 없었습니다. 따라서 settings.gradle( )파일에 코드를 다음과 같이 작성했습니다.