How to disable firebase in test builds in android development? How to make certain code be only in test builds?

    2 answers 2

    if (BuildConfig.DEBUG) { //Код } 

      This can all be done with the help of Product Flavors. Create two productFlavors: one test, one any other. Here is an example.

      • to connect firebase it is enough to add the corresponding dependency in gradle. Can I make some firebase libraries (for example, a crash library) build only in the release version? - JJoe
      • stackoverflow.com/a/24910671/7104538 here's an example of how to connect different for different productFlavors - pavel163