Firebase error (SOLVED)

Steps to reproduce the problem:

  1. Add the Firebase extension to the game (https://github.com/defold/extension-firebase-analytics)
  2. Go to Project/Bundle/Android Aplication…
  3. Click on Create Bundle…
  4. Test the app on a device
  5. The application does not start, a crash report appears on the log.

Expected behavior: The game should start, and should be able to receive firebase events.

Defold version: version 1.2.164, editor sha1 39b2b2d4bd91ffd166a5776bd998912a0ec9758c, engine sha1: 2be2687cbb670c2dbe9cf2e99577bc3338561778

Platforms: Android

Additional context:

  1. I have other extensions in my project (admob,defblend)

31%20PM

  1. In the instructions of firebase extension there are 4 files to add to the project.

A) https://github.com/defold/android-base-extensions/releases/download/1.0.0/firebase-core-16.0.8.zip
B) https://github.com/defold/android-base-extensions/releases/download/1.0.0/gps-base-16.1.0.zip
C) https://github.com/defold/android-base-extensions/releases/download/1.0.0/support-v4-26.1.0.zip
D) https://github.com/defold/android-base-extensions/releases/download/1.0.0/gps-measurement-16.4.0.zip

Some files I already have in my project (B,C). A and B files generate conflicts when added to the project., an .apk file cannot be generated if they are added to the project.

  1. The init method is called according to the log ( “Firebase_init” and “Creating App” messages). This is the call to firebase in the main file.

25%20PM

Does it still crash if you remove the AdMob extension?

Maybe is the same issue?

Yeah, I removed the extension and got the same crash.

43%20PM

Yes, I think is the same issue…

We’re working on a new way to specify (gradle) dependencies for an extension (e.g. for firebase).
This will help maintain and write extensions, and to make sure the resolved dependencies work together.
The goal is to ship this in 1.2.165.

3 Likes

Ok!, I’ll try when the next version is ready.

Thanks

Hello!,

I am trying again with the 1.2.165 version of the editor, but i am getting the same error.

This is my editor version:

editor

this are my dependencies:

dependencias

and this is the error i get when calling firebase.init()

@lrx managed to make both work Firebase and Admob, but i still have the same problem.

Any help is welcome.

Greetings

We have together with some of our users identified a problem with how we bring the Gradle and extension resources (like the google-services.xml) together into the final APK. We may have a workaround that @AJirenius will be testing and we will deploy a fix to the build server on Monday and then a fix in bob.jar this week which will be available as an alpha. We’ll update you when we know more. Sorry for the inconvenience!

1 Like

Ok! I hope the fix works. I will test again in the new version.

Hi,

i tested again with 1.2.166 version of the editor, and the results are the same.

03-03 13:45:32.312 9411 10366 I defold : INFO:Firebase: Firebase_Init
03-03 13:45:32.312 9411 10366 I defold : INFO:Firebase: Creating app
03-03 13:45:32.340 9411 10366 I defold : INFO:CRASH: Successfully wrote Crashdump to file: /data/user/0/com.heizhu.brokenskulls/files/_crash
03-03 13:45:32.340 9411 10366 E defold : ERROR:CRASH: CALL STACK:
03-03 13:45:32.340 9411 10366 E defold :
03-03 13:45:32.340 9411 10366 E defold : # 0 pc 0x638 [vdso] +0
03-03 13:45:32.340 9411 10366 E defold : # 1 pc 0x21efc /system/lib64/libc.so abort+112

Is there another way to use Google Analytics and Admob at the same time? This is the last thing I have to put in my game for its launch, but I don’t think there’s a solution in the short term. I’ve been waiting for this fix since December.

Maybe it’s a better idea to try to mix the two extensions by myself?

Any help is welcome.

Greetings

Can you provide a list of your exact dependencies in game.project so that I can try?

I am using this three extensions:

https://github.com/Lerg/extension-admob/archive/dev.zip
https://github.com/subsoap/defblend/archive/master.zip
https://github.com/defold/extension-firebase-analytics/archive/1.3.2.zip

Thanks. And the crash happens immediately on startup?

Yes, I am testing on the device. After clicking on the game icon, the screens turns Black for 1 second, then the game closes.

I added extension-admob and extension-firebase-analytics to an empty project. I added a single script:

local function listener(event)
	if event.phase == 'init' then
		print("init done")
	end
end

function init(self)
	print("init")
	admob.init({
		test = true,
		listener = listener
	})
	firebase.init()
end

I have followed the setup instructions for Firebase and added the google-services.xml to bundle resources.

For AdMob I have also followed the instructions and added android_app_id to game.project.

I installed on an Android device. The application starts, does not crash and logcat shows:

INFO:ENGINE: Engine service started on port 8001
INFO:ENGINE: Defold Engine 1.2.166 (5295afb)
INFO:ENGINE: Loading data from: dmanif:game.dmanifest
INFO:ENGINE: Initialised sound device 'default'
DEBUG:SCRIPT: init
INFO:Firebase: Firebase_Init
INFO:Firebase: Creating app
Firebase App initializing app com.example.todo (default 1).
Firebase Analytics API Initializing
analytics API Initialized
INFO:Firebase: Firebase_Init done
DEBUG:SCRIPT: init done
1 Like

Ok, i will try to see what is different with my code, and where is my mistake.

Greetings

Thanks for the help, my game is working with both extensions without problems.

My mistake was with the bundle-resources property path, it was not correct.

Thank you very much.

1 Like