Sitelet https://github.com/mk-5/gdx-fireapp/wiki/Android-guide
Skip to content

Android guide

Mk5 edited this page Oct 18, 2020 · 11 revisions

NOTE! Firebase Crash Reporting will be unavailable after 9 September 2018. Crash reporting should be done by Crashlytics and Fabric. Read this Crashlytics wiki page if you need it

Complete guide is here: https://firebase.google.com/docs/android/setup

In short:

  • Add the google-services classpath to the buildscript:

    buildscript{
      // ...
      dependencies {
         classpath 'com.google.gms:google-services:4.3.4'
      }
    }
  • Modify android/build.gradle as follow:

    // dependencies 
    dependencies{
      implementation "pl.mk5.gdx-fireapp:gdx-fireapp-android:$gdxFireappVersion" // the version you are using
    
      implementation platform("com.google.firebase:firebase-bom:25.12.0")
      implementation 'com.google.firebase:firebase-core'
      implementation 'com.google.firebase:firebase-storage'
      implementation 'com.google.firebase:firebase-auth'
      implementation 'com.google.firebase:firebase-database'
      implementation 'com.google.firebase:firebase-crashlytics'
      implementation 'com.google.firebase:firebase-analytics'
    
      // Add this if you need google authorization
      implementation 'com.google.android.gms:play-services-auth:18.1.0'
    }
    
    // put following line at bottom of the file
    apply plugin: 'com.google.gms.google-services'

    If you have a problem with google dependencies the google maven repository is probably missing. You should add it then.

    repositories {
       maven { url 'https://maven.google.com' }
       // or google() depends of your build tools version.
    }
  • Add google-services.json (it is a firebase android configuration file, you can download it from firebase console) at android/google-services.json

  • That's it ! ;)

Clone this wiki locally