skip to Main Content

I have created a project using the Kotlin Multiplatform Wizard.
I have a project in Firebase and have downloaded the google-services.json file.
Do I place this file at the same level as composeApp or at the level of androidApp?

I have tried adding these files at both locations but always get this exception –
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.github.ksalil.gamehub. Make sure to call FirebaseApp.initializeApp(Context) first.

I also added the FirebaseApp.initializeApp(Context) as suggested in the exception in onCreate() of my application class.

This is the project structure

enter image description here

Where do I add the google-services.json for a compose multiplatform project?

2

Answers


  1. Chosen as BEST ANSWER

    I was missing this plugin, id("com.google.gms.google-services") version "4.4.2" apply false in the respective build files. After adding it I can access Firebase in my app.


  2. Where do I add the google-services.json for a compose multiplatform project?

    The google-services.json file should be placed in a Compose Multiplatform project inside:

    root/android/app
    

    On the other hand, the GoogleService-Info.plist file should be placed in a Compose Multiplatform project inside:

    root/ios/app/KotlinMultiplatformApp
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search