Hint: Place google-services.json inside the app folder [OK]
Common Mistakes:
Putting google-services.json in the project root
Not syncing project after adding the file
Ignoring build errors related to Firebase
5. You want to add Firebase Authentication to your Android app. After creating the Firebase project and adding google-services.json, what is the correct sequence to set up your app?
hard
A. Add Firebase Auth dependency, apply google-services plugin, sync project, then initialize FirebaseAuth in code
B. Initialize FirebaseAuth in code, add dependency, apply plugin, then sync project
C. Apply google-services plugin, initialize FirebaseAuth in code, add dependency, then sync project
D. Sync project, add dependency, apply plugin, then initialize FirebaseAuth in code
Solution
Step 1: Add Firebase Auth dependency
First, add the Firebase Authentication library in the app-level build.gradle dependencies.
Step 2: Apply google-services plugin and sync
Apply the google-services plugin in the app-level build.gradle and sync the project to integrate Firebase services.
Step 3: Initialize FirebaseAuth in code
Finally, initialize FirebaseAuth in your Kotlin code to use authentication features.
Final Answer:
Add Firebase Auth dependency, apply google-services plugin, sync project, then initialize FirebaseAuth in code -> Option A
Quick Check:
Dependency -> plugin -> sync -> code init [OK]
Hint: Add dependency and plugin before coding FirebaseAuth [OK]
Common Mistakes:
Initializing FirebaseAuth before adding dependencies
Forgetting to sync project after changes
Applying plugin after coding initialization
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.