[Unity] Game crashes on Android when getting credential from FacebookAuthProvider.

1,360 views
Skip to first unread message

lu...@rubicon-games.com

unread,
Aug 22, 2017, 11:19:47 AM8/22/17
to Firebase Google Group
 When I open the app, it tries to log in to Firebase with credentials it gets from Facebook. This flow works in the editor, and in our iOS build. But for some reason it crashes, when it tries to get the credentials from FacebookAuthProvider.

Credential credential = FacebookAuthProvider.GetCredential(AccessToken.CurrentAccessToken.TokenString);  

I can't find any (relevant) error messages when looking through the output from logcat, but this is the information I get just around the time where the app crashes:

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: mid == null

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]     in call to CallStaticObjectMethodV

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]     from boolean com.unity3d.player.UnityPlayer.nativeRender()

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410] "UnityMain" prio=5 tid=11 Runnable

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   | group="main" sCount=0 dsCount=0 obj=0x12d7e520 self=0xb2ab5300

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   | sysTid=25482 nice=0 cgrp=apps sched=0/0 handle=0xae22d930

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 3105467636 1387842038 6252 ) utm=209 stm=101 core=2 HZ=100

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   | stack=0xae12b000-0xae12d000 stackSize=1038KB

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #00 pc 00371597  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+142)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #01 pc 00350bcd  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEP12BacktraceMap+160)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #02 pc 0025af43  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+742)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #03 pc 0025b69b  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+74)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #04 pc 00273363  /system/lib/libart.so (_ZN3art3JNI23CallStaticObjectMethodVEP7_JNIEnvP7_jclassP10_jmethodIDSt9__va_list+490)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #05 pc 00048bb1  /data/app/com.perseveregames.get9-2/lib/arm/libApp.so (_ZN7_JNIEnv22CallStaticObjectMethodEP7_jclassP10_jmethodIDz+18)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #06 pc 0004f7ef  /data/app/com.perseveregames.get9-2/lib/arm/libApp.so (_ZN8firebase4auth20FacebookAuthProvider13GetCredentialEPKc+54)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #07 pc 0004a2f7  /data/app/com.perseveregames.get9-2/lib/arm/libApp.so (Firebase_Auth_CSharp_FacebookAuthProvider_GetCredential+12)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #08 pc 00f24d90  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #09 pc 00f27cf0  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #10 pc 00864150  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #11 pc 00e7d484  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #12 pc 00b5f9cc  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #13 pc 00e7d484  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #14 pc 00db8a1c  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #15 pc 00d1dfa4  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #16 pc 00dbb650  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #17 pc 007144ec  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #18 pc 00f8a0ec  /data/app/com.perseveregames.get9-2/lib/arm/libil2cpp.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #19 pc 004cd868  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #20 pc 004ddd34  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #21 pc 004e261c  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #22 pc 004e221c  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #23 pc 004abf50  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #24 pc 001d2830  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #25 pc 00316db8  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #26 pc 005ec30c  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #27 pc 005eee9c  /data/app/com.perseveregames.get9-2/lib/arm/libunity.so (???)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   native: #28 pc 00a15069  /data/app/com.perseveregames.get9-2/oat/arm/base.odex (Java_com_unity3d_player_UnityPlayer_nativeRender__+76)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at com.unity3d.player.UnityPlayer.nativeRender(Native method)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at com.unity3d.player.UnityPlayer.a(unavailable:-1)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at com.unity3d.player.UnityPlayer$c$1.handleMessage(unavailable:-1)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at android.os.Handler.dispatchMessage(Handler.java:98)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at android.os.Looper.loop(Looper.java:158)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410]   at com.unity3d.player.UnityPlayer$c.run(unavailable:-1)

08-22 16:04:54.193 25450 25482 F art     : art/runtime/java_vm_ext.cc:410] 

08-22 16:04:54.193 25450 25482 F art     : art/runtime/runtime.cc:368] Runtime aborting...

08-22 16:04:54.193 25450 25482 F art     : art/runtime/runtime.cc:368]


I'm running Unity 5.6.1, Firebase 4.0.3 and running the app on Android API level 23 and 24. Please tell me, if you need any more information.

I really hope you can help, we have been stuck for days now. 

Anthony Maurice

unread,
Aug 22, 2017, 3:15:44 PM8/22/17
to fireba...@googlegroups.com
Hi,

The error that stands out to me there is "JNI DETECTED ERROR IN APPLICATION: mid == null", which means that the Java method id is missing for some reason.  When Firebase is initializing it should be trying to load those, and should print out any errors.  If you can look early in the logs (say around app startup), there might be an error message indicating what the problem is.

Typically this happens because the Android libraries are out of date or missing.  Something to confirm is if you go to "Assets > Play Services Resolver > Android Resolver > Resolve Client Jars", as that should check for (and get if necessary) the Android dependencies.

If that doesn't work, please let me know, with the earlier logs if possible.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/0f1f218b-0421-48b6-95cd-1625fe5680c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony Maurice

unread,
Aug 22, 2017, 5:52:44 PM8/22/17
to fireba...@googlegroups.com
I looked into it a bit more, and found a problem within the SDK that might be causing your problem.  It only searches for those Java methods when you create a FirebaseAuth object, so if you call a GetCredential function before creating that, you can see the problem you are running into.

For a workaround, you can simply add:
  var auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
prior to calling GetCredential, which should initialize it all correctly.

We'll be sure to have a proper fix in the SDK to prevent the need for that soon, but in the meantime that should get you going (if this is indeed the problem you are running into)

Michał Bakalarski

unread,
Jul 17, 2018, 9:53:31 AM7/17/18
to Firebase Google Group
This works, and should be mentioned in documentation, order of instantiation is still important.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages