Skip to content Skip to sidebar Skip to footer

How To Run Debug App Version On A 'debug' Firebase Database

in the Google I/O 2016 sessions the big improvements towards full integration of Firebase has been shown. In my apps, I'm trying to migrate to the new solution(s) but have several

Solution 1:

I am not sure that it is the best practice.

You can use different google-services.json files.
I am investiganting about the current plugin (com.google.gms:google-services:3.0.0) if it supports build types. The previous one (com.google.gms:google-services:2.1.X) supported flavors but not types.

In any case you should be able to use somenthing like this:

app/src/release/google-services.json
app/google-services.json

In this case the plugin looks in the locations and stops when it finds a google-services.json file.

In this way you should be able to use different firebase apps for debug and release.


Solution 2:

There is no need for various google-services.json files as the answer above specifies. Instead in Firebase you create a project. Each project can have multiple apps (even across different platforms).

In my case for instance I have two build types (debug and release) and two productFlavors resulting in 4 apps with different package names:

  • fullDebug: com.company.myapp.debug
  • fullRelease: com.company.myapp
  • demoDebug: com.company.myapp.demo.debug
  • demoRelease: com.company.myapp.demo

One google-services.json file covers all of these variants and should just be put into the app module of your Android Studio project.


Post a Comment for "How To Run Debug App Version On A 'debug' Firebase Database"