I wrote this guide about how to install firebase analytics in godot because I struggled and it may be useful for the future me and others.
This guide explains how to install the nativelib Addon: https://drmoriarty.github.io/nativelib/guide/gui-usage.html#installation
In short:
- In the top bar of Godot click on
AssetLib
next to2D, 3D, Script
- Look for
NativeLib
and install it - Go to
Project Settings > Plugins
and make sure bothNativeLib
andNativeLib export plugin
are both installed
- In the top bar of Godot click on
NativeLib
next to2D, 3D, Script, AssetLib
- Then activate the platform you want to add your plugins for (for example android and iOS)
- Then look for your plugin and click install and wait a bit until it installs
- For iOS put the
GoogleService-Info.plist
inaddons/nativelib-export/iOS
- For Android put the
google-services.json
inandroid/build
- Go to
Project > Export
- Click on your export (like the android)
- Go to the
Plugins
section and activateFirebase Analytics
- You will be asked to activate
Use Custom Build
do so
Follow what google says here: https://firebase.google.com/docs/android/setup#add-config-file
Basically add those lines commented here:
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// ...
// Add the following line:
classpath 'com.google.gms:google-services:4.3.10' // Google Services plugin
}
}
apply plugin: 'com.android.application'
// Add the following line:
apply plugin: 'com.google.gms.google-services' // Google Services plugin
android {
// ...
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
Follow the official doc here about how to use in your code: https://github.com/DrMoriarty/nativelib