Android Build crash on boot - ApiKey must be set

800 views
Skip to first unread message

tom....@goodcatchgames.com

unread,
Sep 27, 2017, 10:04:18 AM9/27/17
to Firebase Google Group
Hi,

I am having some issues with the Firebase SDK booting on android(please see the log below). I've updated the SDK to 4.1 and had some issues with the play services, as Unity would not build and kept producing duplicate library errors. After looking through some of the issues encountered by others, I upgraded the GooglePlayGamesPlugin and the play services resolver following other peoples advice and trials here:


After some trial and error with the different versions I found that also getting the latest play services resolver from the repository helped fix the issue to some extend. I was then able to build for android. Unfortunately iOS would fail at the linking stage. I found that going back one version on the GooglePlayGamesPlugin resolved this issue for me. So currently I have everything at the following version:

GooglePlayGamesPlugin-0.9.40
firebase unity sdk 4.1
play-services-resolver-1.2.52.0
















unity 2017.1.0f3

I can build to iOS and it runs, but when I build to android the app will initially start, but then crash and I get the following output from logcat:

09-26 20:17:06.791 32086 32159 E Unity   : Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
09-26 20:17:07.044 32086 32159 I Unity   : Firebase App initializing app com.goodcatchgames.<GAME-NAME> (default 1).
09-26 20:17:07.044 32086 32159 I Unity   :  
09-26 20:17:07.044 32086 32159 I Unity   : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-26 20:17:07.044 32086 32159 I Unity   : 
09-26 20:17:07.047 32086 32159 E Unity   : strlen(app_options->app_id()) && strlen(app_options->api_key())
09-26 20:17:07.047 32086 32159 E Unity   :  
09-26 20:17:07.047 32086 32159 E Unity   : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
09-26 20:17:07.047 32086 32159 E Unity   : 
09-26 20:17:07.264   634   634 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-26 20:17:07.265   634   634 F DEBUG   : Build fingerprint: 'samsung/greatltexx/greatlte:7.1.1/NMF26X/N950FXXU1AQI1:user/release-keys'
09-26 20:17:07.265   634   634 F DEBUG   : Revision: '9'
09-26 20:17:07.265   634   634 F DEBUG   : ABI: 'arm'
09-26 20:17:07.265   634   634 F DEBUG   : pid: 32086, tid: 32159, name: UnityMain  >>> com.goodcatchgames.<GAME-NAME> <<<
09-26 20:17:07.265   634   634 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-26 20:17:07.268   634   634 F DEBUG   : Abort message: 'art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.IllegalArgumentException: ApiKey must be set.'
09-26 20:17:07.268   634   634 F DEBUG   :     r0 00000000  r1 00007d9f  r2 00000006  r3 00000008
09-26 20:17:07.268   634   634 F DEBUG   :     r4 ed3bc978  r5 00000006  r6 ed3bc920  r7 0000010c
09-26 20:17:07.268   634   634 F DEBUG   :     r8 00000000  r9 0000000a  sl 00000f5b  fp e7c0d400
09-26 20:17:07.268   634   634 F DEBUG   :     ip 0000000b  sp ed3ba5d8  lr ef2a2097  pc ef2a48f4  cpsr 200f0010
09-26 20:17:07.280   634   634 F DEBUG   : 
09-26 20:17:07.280   634   634 F DEBUG   : backtrace:
09-26 20:17:07.281   634   634 F DEBUG   :     #00 pc 0004a8f4  /system/lib/libc.so (tgkill+12)
09-26 20:17:07.281   634   634 F DEBUG   :     #01 pc 00048093  /system/lib/libc.so (pthread_kill+34)
09-26 20:17:07.281   634   634 F DEBUG   :     #02 pc 0001db6d  /system/lib/libc.so (raise+10)
09-26 20:17:07.281   634   634 F DEBUG   :     #03 pc 00019271  /system/lib/libc.so (__libc_android_abort+34)
09-26 20:17:07.281   634   634 F DEBUG   :     #04 pc 0001718c  /system/lib/libc.so (abort+4)
09-26 20:17:07.281   634   634 F DEBUG   :     #05 pc 0031ba51  /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+328)
09-26 20:17:07.281   634   634 F DEBUG   :     #06 pc 000b544d  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+1132)
09-26 20:17:07.281   634   634 F DEBUG   :     #07 pc 0023abb5  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1664)
09-26 20:17:07.281   634   634 F DEBUG   :     #08 pc 0023ada7  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
09-26 20:17:07.281   634   634 F DEBUG   :     #09 pc 000cadfb  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
09-26 20:17:07.281   634   634 F DEBUG   :     #10 pc 000ca9e7  /system/lib/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+362)
09-26 20:17:07.281   634   634 F DEBUG   :     #11 pc 000c99ff  /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+26)
09-26 20:17:07.281   634   634 F DEBUG   :     #12 pc 000c8edb  /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+802)
09-26 20:17:07.281   634   634 F DEBUG   :     #13 pc 000cd087  /system/lib/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+114)
09-26 20:17:07.281   634   634 F DEBUG   :     #14 pc 000cc6b5  /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+512)
09-26 20:17:07.282   634   634 F DEBUG   :     #15 pc 000c1eef  /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+42)
09-26 20:17:07.282   634   634 F DEBUG   :     #16 pc 0004c7c1  /data/app/com.goodcatchgames.<GAME-NAME>-1/lib/arm/libApp.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18)
09-26 20:17:07.282   634   634 F DEBUG   :     #17 pc 00065da1  /data/app/com.goodcatchgames.<GAME-NAME>-1/lib/arm/libApp.so (_ZN8firebase12_GLOBAL__N_1L21CreateFirebaseOptionsEP7_JNIEnvRKNS_10AppOptionsE+224)
09-26 20:17:07.282   634   634 F DEBUG   :     #18 pc 000664f7  /data/app/com.goodcatchgames.<GAME-NAME>-1/lib/arm/libApp.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEPKcP7_JNIEnvP8_jobject+310)
09-26 20:17:07.282   634   634 F DEBUG   :     #19 pc 0004767f  /data/app/com.goodcatchgames.<GAME-NAME>-1/lib/arm/libApp.so (_ZN8firebaseL9AppCreateEPKNS_10AppOptionsEPKc+94)
09-26 20:17:07.282   634   634 F DEBUG   :     #20 pc 000479ab  /data/app/com.goodcatchgames.<GAME-NAME>-1/lib/arm/libApp.so (_ZN8firebaseL21AppGetDefaultInstanceEPKNS_10AppOptionsE+26)
09-26 20:17:07.282   634   634 F DEBUG   :     #21 pc 00002fb4  <anonymous:cb660000>
09-26 20:17:09.010  3790   636 W ActivityManager:   Force finishing activity com.goodcatchgames.<GAME-NAME>/com.google.firebase.MessagingUnityPlayerActivity


I am wondering if anyone has experienced this issue? I have highlighted the areas that look to be the main issue. The missing CoreFoundation seems odd, as this looks like an iOS file from the naming. I did think it might be a dll I have set to import for android when it should not be in the Unity import settings, but I cannot find anything after combing through the various Firebase and GPS files. The second issues seems to be possibly coming from a Firebase jar but I cannot access the Firebase source code to check this. It might be possible there is an error in the firebase-core-11.4.0 file?

If anyone can provide any help I would appreciate it.

Tom

Stewart Miles

unread,
Sep 27, 2017, 12:51:49 PM9/27/17
to Firebase Google Group
/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation is something generated by Unity, I have no idea why this ends up in Android builds .. mysteries of Unity :)

The error you're seeing "strlen(app_options->app_id()) && strlen(app_options->api_key())" - from an assert in the C++ component and "JNI DETECTED ERROR IN APPLICATION" sounds like a bug to me - I'll poke the team to take a look into that as we should be surfacing a useful message instead.  It's coming from the code that reads the Firebase App configuration from the APK.

From what I can tell, you're missing google-services.json in your project which should result in the Firebase plugin generating Plugins/Android/Firebase/res/values/google-services.xml .  If you don't have a Plugins/Android/Firebase folder, I recommend re-importing the folder from the Firebase*.unitypackage and copying the latest google-services.json (Firebase Android config) into your Unity project again.

Cheers,
Stewart

--
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/a7193efc-55b8-4d28-8c6a-385d35dcd844%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages