Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation #136

Closed
superbybot opened this issue Feb 6, 2018 · 63 comments

Comments

@superbybot
Copy link

I'm trying to build the analytics sample using firebase SDK 4.4.2 and I get an error in the log with message:

"Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"

any ideas whats wrong with it? The only thing I've changed in the unity project is adding google-analytics in the AnalyticsDependencies.xml.

extra-google-m2repository

Thanks in advance for the help!

Regards,
Byron

@superbybot
Copy link
Author

@stewartmiles
Copy link
Contributor

@superbybot the stack overflow link you shared doesn't appear to land on a valid page. You mention adding google-analytics in the AnalyticsDependencies.xml , I don't understand why you need to modify AnalyticsDependencies.xml at all, it should be correct if you import the FirebaseAnalytics.unitypackage .

The missing directory you mention could be due to a broken / partial Xcode install?

On one of my OSX machines I see...

$ ls -l /System/Library/Frameworks/CoreFoundation.framework/
total 32
lrwxr-xr-x  1 root  wheel   31 Dec 27  2016 CoreFoundation -> Versions/Current/CoreFoundation
lrwxr-xr-x  1 root  wheel   24 Jan  8 08:26 Headers -> Versions/Current/Headers
lrwxr-xr-x  1 root  wheel   24 Jan  8 08:26 Modules -> Versions/Current/Modules
lrwxr-xr-x  1 root  wheel   26 Dec 27  2016 Resources -> Versions/Current/Resources
drwxr-xr-x  4 root  wheel  136 Dec 27  2016 Versions

$ ls -l /System/Library/Frameworks/CoreFoundation.framework/Versions/Current/CoreFoundation 
-rwxr-xr-x  1 root  wheel  21879760 Nov 19 20:10 /System/Library/Frameworks/CoreFoundation.framework/Versions/Current/CoreFoundation

So perhaps your CoreFoundation framework is missing on your machine? Though I would assume that would cause issues building anything.

@stewartmiles
Copy link
Contributor

@superbybot while reviewing the fix for #138 today I noticed it explicitly references /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation to detect Unity's broken networking before 2017.3.1f1, the fix in 2017.3.1f1 caused #138. I was wondering whether you could share more information about your development environment as this could be related?

  • Host OS (OSX, Windows, Linux)
  • Unity version
  • .NET version (3.5 or 4.6)
  • Target platform
  • Anything else

Cheers,
Stewart

@johnb003
Copy link

Please try version 4.4.3:
https://firebase.google.com/support/release-notes/unity#4.4.3

We fixed some issues with .NET 4.6 which could have been the cause.

@DooblyNoobly
Copy link

I started to randomly get this problem today where as firebase worked fine yesterday. How could that happen?

@DooblyNoobly
Copy link

@johnb003 please reopen this is not fixed

@johnb003 johnb003 reopened this Feb 24, 2018
@huy2607
Copy link

huy2607 commented Mar 12, 2018

Anyone can fix this ?

@DooblyNoobly
Copy link

Turns out the error "Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" happens even when Firebase is working correctly. Is your analytics not working @huy2607 ?

@huy2607
Copy link

huy2607 commented Mar 12, 2018

i crash everytime i log event by firebase

@huy2607
Copy link

huy2607 commented Mar 12, 2018

Unable to lookup library path for '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation', native render plugin support di Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation Firebase App initializing app com.popa.fredbear.google.android.risingwarriors (default 1). UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) Firebase.FirebaseApp:LogMessage(LogLevel, String) Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0() Firebase.FirebaseApp:CreateInternal() Firebase.FirebaseApp:m__0() Firebase.FirebaseApp:CreateAndTrack(CreateDelegate) Firebase.FirebaseApp:Create() Firebase.FirebaseApp:get_DefaultInstance() Firebase.Analytics.FirebaseAnalytics:.cctor() TrackingTutorialStep:_tracking() (at D:\Rising\RisingWarriors-Unity.git\RisingWarriors\Assets\Scripts\Tracking\TrackingTutorialStep.cs: TrackingTutorialStep:_tracking() (at D:\Rising\RisingWarriors-Unity.git\RisingWarriors\Assets\Scripts\Tracking\TrackingTutorialStep.cs: BaseTrackingAdapter Firebase Analytics API Initializing UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) Firebase.FirebaseApp:LogMessage(LogLevel, String) Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0() Firebase.FirebaseApp:CreateInternal() Firebase.FirebaseApp:m__0() Firebase.FirebaseApp:CreateAndTrack(CreateDelegate) Firebase.FirebaseApp:Create() Firebase.FirebaseApp:get_DefaultInstance() Firebase.Analytics.FirebaseAnalytics:.cctor() TrackingTutorialStep:_tracking() (at D:\Rising\RisingWarriors-Unity.git\RisingWarriors\Assets\Scripts\Tracking\TrackingTutorialStep.cs: TrackingTutorialStep:_tracking() (at D:\Rising\RisingWarriors-Unity.git\RisingWarriors\Assets\Scripts\Tracking\TrackingTutorialStep.cs: BaseTrackingAdapter:tracking() (at D:\Rising\RisingWarriors-Unity.git\Risi Firebase Analytics API Initialized UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) Firebase.FirebaseApp:LogMessage(LogLevel, String) Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0() Firebase.FirebaseApp:CreateInternal() Firebase.FirebaseApp:m__0() Firebase.FirebaseApp:CreateAndTrack(CreateDelegate) Firebase.FirebaseApp:Create() Firebase.FirebaseApp:get_DefaultInstance() Firebase.Analytics.FirebaseAnalytics:.cctor()

@DooblyNoobly
Copy link

it's most likely not due to this issue @huy2607
I would suggest running the Android Jar Resolver from the editor before building

@johnb003
Copy link

Thanks for letting us know there's still an issue.

For any of you still having problems, can you give us some details we can use to try to reproduce this...

Can you reproduce the problem in the samples?
What Unity version are you using?
In your build settings, are you using Development build or regular?

Have a look at your Unity Player Settings:

What version is the .Net? 3.5 or 4.6?
What is your target architecture, Universal, ARMv7, ARM64?
What's your Minimum iOS version set to?
What version of XCode are you using?
What device are you running on?

@huy2607 You report it's crashing on Analytics events? Can you provide any crash logs / callstacks?

@huy2607
Copy link

huy2607 commented Mar 13, 2018

i using unity 2017.2.0f3.
i build to android regular
.Net 3.5
FAT(ARMv7+ ARM64)
device : HUAWEI LITE P8
Crash log : comment before
@johnb003

@huy2607
Copy link

huy2607 commented Mar 13, 2018

i did you suggest but still crash @DooblyNoobly !

@johnb003
Copy link

Oh, that's actually quite helpful! I'm surprised this is coming up for you at all on an Android build.
I guess I assumed you were building for XCode because of the error.

@johnb003
Copy link

@huy2607 You can likely work around the problem for now by updating your Unity to at least 2017.3.

@stewartmiles
Copy link
Contributor

@huy2607 just to confirm, this is causing a crash or simply logging an error to your log? If it's just logging an error that's ok it's harmless we're using this code path to detect broken Unity versions. If it's crashing well then we'll need to resolve this.

@danielandujar
Copy link

@johnb003 i started getting this error, updated to Unity 2017.4, same error.
running on Android, and the error comes as early as trying to get Firebase Instance
auth = FirebaseAuth.DefaultInstance;
build and run for Android and the app crashes (not even the exception catches it)
i go to logcat with this command:
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG;
and this is what i get when the app crashes:

04-12 07:51:51.890 27047 27066 E Unity : Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
04-12 07:51:51.929 27047 27066 I Unity : Firebase App initializing app com.cry.sfxfun (default 1).
04-12 07:51:51.929 27047 27066 I Unity :
04-12 07:51:51.929 27047 27066 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
04-12 07:51:51.929 27047 27066 I Unity :
04-12 07:51:51.932 27047 27066 E Unity : strlen(app_options->app_id()) && strlen(app_options->api_key())
04-12 07:51:51.932 27047 27066 E Unity :
04-12 07:51:51.932 27047 27066 E Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
04-12 07:51:51.932 27047 27066 E Unity :
04-12 07:51:52.326 27133 27133 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-12 07:51:52.327 27133 27133 F DEBUG : Build fingerprint: 'samsung/dream2ltexx/dream2lte:7.0/NRD90M/G955FXXU1AQF7:user/release-keys'
04-12 07:51:52.327 27133 27133 F DEBUG : Revision: '10'
04-12 07:51:52.327 27133 27133 F DEBUG : ABI: 'arm'
04-12 07:51:52.327 27133 27133 F DEBUG : pid: 27047, tid: 27066, name: UnityMain >>> com.cry.sfxfun <<<
04-12 07:51:52.328 27133 27133 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-12 07:51:52.333 27133 27133 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.'
04-12 07:51:52.333 27133 27133 F DEBUG : r0 00000000 r1 000069ba r2 00000006 r3 00000008
04-12 07:51:52.333 27133 27133 F DEBUG : r4 e89b9978 r5 00000006 r6 e89b9920 r7 0000010c
04-12 07:51:52.333 27133 27133 F DEBUG : r8 00000000 r9 f2669e84 sl 00000ef4 fp f262f63f
04-12 07:51:52.333 27133 27133 F DEBUG : ip 0000000b sp e89b7870 lr f467af97 pc f467d7f4 cpsr 200f0010
04-12 07:51:52.356 27133 27133 F DEBUG :
04-12 07:51:52.356 27133 27133 F DEBUG : backtrace:
04-12 07:51:52.356 27133 27133 F DEBUG : #00 pc 0004a7f4 /system/lib/libc.so (tgkill+12)
04-12 07:51:52.356 27133 27133 F DEBUG : #1 pc 00047f93 /system/lib/libc.so (pthread_kill+34)
04-12 07:51:52.356 27133 27133 F DEBUG : #2 pc 0001daad /system/lib/libc.so (raise+10)
04-12 07:51:52.356 27133 27133 F DEBUG : #3 pc 00019231 /system/lib/libc.so (__libc_android_abort+34)
04-12 07:51:52.356 27133 27133 F DEBUG : #4 pc 0001714c /system/lib/libc.so (abort+4)
04-12 07:51:52.356 27133 27133 F DEBUG : #5 pc 00318b4d /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252)
04-12 07:51:52.356 27133 27133 F DEBUG : #6 pc 000b4ac1 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+864)
04-12 07:51:52.356 27133 27133 F DEBUG : #7 pc 00238a95 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+1664)
04-12 07:51:52.356 27133 27133 F DEBUG : #8 pc 00238c87 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
04-12 07:51:52.356 27133 27133 F DEBUG : #9 pc 000ca46b /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
04-12 07:51:52.356 27133 27133 F DEBUG : #10 pc 000ca057 /system/lib/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+362)
04-12 07:51:52.357 27133 27133 F DEBUG : #11 pc 000c906f /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+26)
04-12 07:51:52.357 27133 27133 F DEBUG : #12 pc 000c854b /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+802)
04-12 07:51:52.357 27133 27133 F DEBUG : #13 pc 000cc6f7 /system/lib/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+114)
04-12 07:51:52.357 27133 27133 F DEBUG : #14 pc 000cbd25 /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+512)
04-12 07:51:52.357 27133 27133 F DEBUG : #15 pc 000c155f /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+42)
04-12 07:51:52.357 27133 27133 F DEBUG : #16 pc 0008a06d /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.0.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18)
04-12 07:51:52.357 27133 27133 F DEBUG : #17 pc 000d0b25 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.0.so (_ZN8firebase12_GLOBAL__N_1L21CreateFirebaseOptionsEP7_JNIEnvRKNS_10AppOptionsE+228)
04-12 07:51:52.357 27133 27133 F DEBUG : #18 pc 000d127b /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.0.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEPKcP7_JNIEnvP8_jobject+310)
04-12 07:51:52.357 27133 27133 F DEBUG : #19 pc 00084887 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.0.so (_ZN8firebaseL9AppCreateEPKNS_10AppOptionsEPKc+90)
04-12 07:51:52.357 27133 27133 F DEBUG : #20 pc 00084bf3 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.0.so (_ZN8firebaseL21AppGetDefaultInstanceEPKNS_10AppOptionsE+26)
04-12 07:51:52.357 27133 27133 F DEBUG : #21 pc 000096dc anonymous:c9ec7000
04-12 07:51:54.183 3680 27134 W ActivityManager: Force finishing activity

com.cry.sfxfun/com.unity3d.player.UnityPlayerActivity

@MartinGonzalez
Copy link

MartinGonzalez commented Apr 15, 2018

Same here.
Unity version: 2017.3.1p2
Net: 3.5
I'm using a custom UnityPlayerActivity and added this:

    @Override
    public void onNewIntent(Intent intent) {
        Log.d(EtermaxUnityPlayerActivity.ETERMAX_TAG, "Firebase on new Intent");
        Activity activity = UnityPlayer.currentActivity;
        Intent message = new Intent(activity, MessageForwardingService.class);
        message.setAction(MessageForwardingService.ACTION_REMOTE_INTENT);
        message.putExtras(intent);
        activity.startService(message);

    }

I receive that error too

04-15 01:19:21.572 7286-7304/? E/Unity: Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

And seems to randomly crash.

I was able to receive push notifications but sometime it crash my app.

EDIT:

Using Unity i had to set my applications as a SingleTask in the manifest, after that it stop crashing

@danielandujar
Copy link

Please i need help, my development has halted because of this issue

@stewartmiles
Copy link
Contributor

Ok I think what we're going to do here - since we still can't figure out the root cause - is disable root cert installation unless the real-time database plugin is installed since that is the only component that requires this now. We previously required root certs for the storage module as well but we moved to native implementations on all supported platforms in 4.5.0. We'll post an update with a workaround DLL shortly.

@stewartmiles
Copy link
Contributor

Ok I've patched Firebase.App.dll and Firebase.Auth.dll based upon the 4.5.1 release. I've done a couple of things:

  • Changed root certificate installation to only occur if required (we now only need to install root certs for the real-time database component, the requirement should go away soon but we're not there yet)
  • Modified our workaround for cert validation on OSX when using .NET 4.6 in an attempt to delay DLL loading.

Some of the reported problems, especially by @blackknigt, confuse me since the code path that causes us to load /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation shouldn't happen unless we're running on OSX in the editor. @blackknigt could you share all build options used to target Android? Any chance you're using IL2CPP?

Since we've been unable to reproduce this issue on any of our machines I would love feedback on whether my patch works for you, what you need to do to apply it:

  1. Upgrade your project(s) to the 4.5.1 plugin(s) see https://firebase.google.com/docs/unity/setup
  2. Download and unpack the attached issue136patch1.zip into Assets/Firebase/Plugins (you should be replacing the existing Firebase.App.dll and Firebase.Platform.dll)
  3. Give it a try
  4. Provide feedback on this thread

@danielandujar
Copy link

Currently downloading the update:
My build machine is a Mac, but the crash happens on my Galaxy S8.
i haven't touched build settings, all default:
screen shot 2018-04-18 at 1 24 12 pm
screen shot 2018-04-18 at 1 27 42 pm

@danielandujar
Copy link

ok, i got the same error, i will start clean and will try to start firebase without any other code... to see what happens

04-18 13:49:04.471 18541 18556 E Unity : Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 04-18 13:49:04.508 18541 18556 I Unity : Firebase App initializing app com.cry.sfxfun (default 1). 04-18 13:49:04.508 18541 18556 I Unity : 04-18 13:49:04.508 18541 18556 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51) 04-18 13:49:04.508 18541 18556 I Unity : 04-18 13:49:04.509 18541 18556 E Unity : strlen(app_options->app_id()) && strlen(app_options->api_key()) 04-18 13:49:04.509 18541 18556 E Unity : 04-18 13:49:04.509 18541 18556 E Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51) 04-18 13:49:04.509 18541 18556 E Unity : 04-18 13:49:04.711 18734 18734 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-18 13:49:04.712 18734 18734 F DEBUG : Build fingerprint: 'samsung/dream2ltexx/dream2lte:7.0/NRD90M/G955FXXU1AQF7:user/release-keys' 04-18 13:49:04.712 18734 18734 F DEBUG : Revision: '10' 04-18 13:49:04.712 18734 18734 F DEBUG : ABI: 'arm' 04-18 13:49:04.712 18734 18734 F DEBUG : pid: 18541, tid: 18556, name: UnityMain >>> com.cry.sfxfun <<< 04-18 13:49:04.712 18734 18734 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 04-18 13:49:04.715 18734 18734 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.' 04-18 13:49:04.715 18734 18734 F DEBUG : r0 00000000 r1 0000487c r2 00000006 r3 00000008 04-18 13:49:04.715 18734 18734 F DEBUG : r4 e8989978 r5 00000006 r6 e8989920 r7 0000010c 04-18 13:49:04.715 18734 18734 F DEBUG : r8 00000000 r9 f2669e84 sl 00000f73 fp f262f63f 04-18 13:49:04.715 18734 18734 F DEBUG : ip 0000000b sp e8987798 lr f467af97 pc f467d7f4 cpsr 200f0010 04-18 13:49:04.732 18734 18734 F DEBUG : 04-18 13:49:04.732 18734 18734 F DEBUG : backtrace: 04-18 13:49:04.732 18734 18734 F DEBUG : #00 pc 0004a7f4 /system/lib/libc.so (tgkill+12) 04-18 13:49:04.732 18734 18734 F DEBUG : #01 pc 00047f93 /system/lib/libc.so (pthread_kill+34) 04-18 13:49:04.732 18734 18734 F DEBUG : #02 pc 0001daad /system/lib/libc.so (raise+10) 04-18 13:49:04.732 18734 18734 F DEBUG : #03 pc 00019231 /system/lib/libc.so (__libc_android_abort+34) 04-18 13:49:04.732 18734 18734 F DEBUG : #04 pc 0001714c /system/lib/libc.so (abort+4) 04-18 13:49:04.732 18734 18734 F DEBUG : #05 pc 00318b4d /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252) 04-18 13:49:04.732 18734 18734 F DEBUG : #06 pc 000b4ac1 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+864) 04-18 13:49:04.732 18734 18734 F DEBUG : #07 pc 00238a95 /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1664) 04-18 13:49:04.732 18734 18734 F DEBUG : #08 pc 00238c87 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58) 04-18 13:49:04.732 18734 18734 F DEBUG : #09 pc 000ca46b /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46) 04-18 13:49:04.732 18734 18734 F DEBUG : #10 pc 000ca057 /system/lib/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+362) 04-18 13:49:04.732 18734 18734 F DEBUG : #11 pc 000c906f /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+26) 04-18 13:49:04.732 18734 18734 F DEBUG : #12 pc 000c854b /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+802) 04-18 13:49:04.733 18734 18734 F DEBUG : #13 pc 000cc6f7 /system/lib/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+114) 04-18 13:49:04.733 18734 18734 F DEBUG : #14 pc 000cbd25 /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+512) 04-18 13:49:04.733 18734 18734 F DEBUG : #15 pc 000c155f /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+42) 04-18 13:49:04.733 18734 18734 F DEBUG : #16 pc 000b0513 /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18) 04-18 13:49:04.733 18734 18734 F DEBUG : #17 pc 000f7c21 /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN8firebase12_GLOBAL__N_1L21CreateFirebaseOptionsEP7_JNIEnvRKNS_10AppOptionsE+220) 04-18 13:49:04.733 18734 18734 F DEBUG : #18 pc 000f7653 /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEPKcP7_JNIEnvP8_jobject+594) 04-18 13:49:04.733 18734 18734 F DEBUG : #19 pc 000a77f3 /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN8firebase3App6CreateEP7_JNIEnvP8_jobject+18) 04-18 13:49:04.733 18734 18734 F DEBUG : #20 pc 000a7385 /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN8firebaseL9AppCreateEPKNS_10AppOptionsEPKc+68) 04-18 13:49:04.733 18734 18734 F DEBUG : #21 pc 000a731b /data/app/com.cry.sfxfun-2/lib/arm/libApp-4.5.1.so (_ZN8firebaseL21AppGetDefaultInstanceEPKNS_10AppOptionsE+26) 04-18 13:49:04.733 18734 18734 F DEBUG : #22 pc 000097dc <anonymous:ca10c000> 04-18 13:49:06.418 3680 18798 W ActivityManager: Force finishing activity com.cry.sfxfun/com.unity3d.player.UnityPlayerActivity

@stewartmiles
Copy link
Contributor

@blackknigt thanks for posting your build settings. Could you also enable debug logging and post the log?

Set Firebase.FirebaseApp.LogLevel to Firebase.LogLevel.Debug before calling any Firebase methods.

@stewartmiles
Copy link
Contributor

stewartmiles commented Apr 20, 2018

@dday1987 do you have the complete log from that device rather than a screenshot? I'm wondering whether that error message actually stops execution?

Also, any chance you could enable debug logging so that we can see what's going on in more detail.
You need to add the following line before any calls to Firebase:

Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;

@wapa5pow
Copy link

I recently updated firebase unity sdk to 4.5.1 and I also got the 04-21 08:04:36.625 30125-30165/? E/firebase: Failed to read Firebase options from the app's resources. You'll need to either at least set App ID and API key or include google-services.json your app's resources. error.

Host OS (OSX, Windows, Linux): OSX
Unity version: 2017.4.1f1
.NET version (3.5 or 4.6): to the following image
Target platform: Android

image

I have the google-services.json file as follows. There is also ./Assets/Plugins/Android/Firebase/res/values/google-services.xml file which includes app_id and app_key information.

$ find . | grep google-services
./Temp/StagingArea/raw/google-services-desktop.json
./Builds/ios4/Data/Raw/google-services-desktop.json
./Assets/Plugins/Android/Firebase/res/values/google-services.xml.meta
./Assets/Plugins/Android/Firebase/res/values/google-services.xml
./Assets/Firebase/google-services.json.meta
./Assets/Firebase/google-services.json
./Assets/StreamingAssets/google-services-desktop.json.meta
./Assets/StreamingAssets/google-services-desktop.json

I also tried #136 (comment) .
I have still same error as follows

04-21 08:04:36.625 30125-30165/? E/firebase: strlen(app_options->app_id()) && strlen(app_options->api_key())
04-21 08:04:36.625 30125-30165/? E/Unity: strlen(app_options->app_id()) && strlen(app_options->api_key())
                                           
                                          (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
04-21 08:04:36.625 30125-30165/? E/firebase: Failed to read Firebase options from the app's resources.  You'll need to either at least set App ID and API key or include google-services.json your app's resources.
04-21 08:04:36.625 30125-30165/? I/Unity: Failed to read Firebase options from the app's resources.  You'll need to either at least set App ID and API key or include google-services.json your app's resources.
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.IllegalArgumentException: ApiKey must be set.
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at java.lang.String com.google.android.gms.common.internal.zzbq.zzh(java.lang.String, java.lang.Object) ((null):-1)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at com.google.firebase.FirebaseOptions$Builder com.google.firebase.FirebaseOptions$Builder.setApiKey(java.lang.String) ((null):-1)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at boolean com.unity3d.player.UnityPlayer.nativeRender() ((null):-2)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at boolean com.unity3d.player.UnityPlayer.c(com.unity3d.player.UnityPlayer) ((null):-1)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at boolean com.unity3d.player.UnityPlayer$e$2.queueIdle() ((null):-1)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:394)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at void android.os.Looper.loop() (Looper.java:142)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   at void com.unity3d.player.UnityPlayer$e.run() ((null):-1)
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534] 
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]     in call to CallObjectMethodV
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]     from boolean com.unity3d.player.UnityPlayer.nativeRender()
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534] "UnityMain" prio=5 tid=11 Runnable
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   | group="main" sCount=0 dsCount=0 flags=0 obj=0x14078718 self=0xe4b7a600
04-21 08:04:36.701 30125-30165/? A/zygote: java_vm_ext.cc:534]   | sysTid=30165 nice=0 cgrp=default sched=0/0 handle=0xd3c46970

@stewartmiles
Copy link
Contributor

@wapa5pow could you open a ticket on http://firebase.google.com/support and share your project with them? That will make its way down to the engineering team (us) and we'll be able to take a look.

@wapa5pow
Copy link

I don't know it helped or not but I did the following and the problem was solved.

  1. Upgrade Android Studio from 2.3 to 3.1.1 (latest)
  2. Reimport Firebase Unity Plugins (FirebaseAnalytics.unitypackage, FirebaseMessaging.unitypackage, FirebaseRemoteConfig.unitypackage)
  3. Uncheck builds-tool and apply

image

@stewartmiles
Copy link
Contributor

We've released a fix for the issue cited in this bug's title in 4.5.2 https://firebase.google.com/support/release-notes/unity#4.5.2 when using plugins other than the Realtime Database. We're still working on removing the dependency upon root cert installation in the Realtime Database, it's going to take probably another month or so.

w.r.t the problems folks are reporting with Firebase config resources not ending up in Android projects, please open up tickets with Firebase support. We haven't been able to reproduce these issues so I'm guessing it's something special about how you're building your project or your build environment (Android SDK, Unity version, host OS etc.). It will be easier for us to reproduce by starting with a common environment when communicating privately with us via our support channel

@claire828
Copy link

The same issue occurs.
I'm wondering does the version 4.5.2 being released yet?
As I've checked the official site where I downloaded before, the version is still 4.5.1.

@stewartmiles
Copy link
Contributor

@claire828 apologies, looks like our redirect link wasn't republished yesterday, it's up to date now. Thank you for pointing this out!
If you're still having issues it's available directly via:
https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_4.5.2.zip

@claire828
Copy link

Problem solve!! After updating to 4.5.2, everything works fine now! Thanks! 😀

@hieupt1289
Copy link

@claire828 In my case, this bug still happen with Firebase SDK 4.5.2. Can you let me know your Unity version? Thank.

@pronaypeddiraju
Copy link

Hey there @LvM2D, I was facing this issue on my project but I was able to resolve it using the following:

  • Used Unity version 2017.3.1p3
  • Used Firebase SDK 4.5.2
  • Ensured that I have the required Android SDK tools

I currently have the project's minimum API requirement set to Android 5.0 or API Level 21. After following the instructions for integrating Firebase, everything has worked smoothly for me.

NOTE: I am only using the Firebase messaging package. But I assume there should be no problem with the other ones too

@claire828
Copy link

claire828 commented Jun 2, 2018

Hey @LvM2D
In unity 3.6.6, the Firebase 4.5.2 works fine on Android.
After upgrading to Unity 5.6.6, Both Android and IOS work!
Hope this information help!

@hieupt1289
Copy link

hieupt1289 commented Jun 2, 2018

@claire828 Now it works, thank for your help.
@pronaypeddiraju . Thank for suggest. Now I use the latest Unity version (5.6.6), the latest Firebase SDK and also Play services resolver. And final, I uncheck Proguard in Player setting/Minify.

@enghoff
Copy link

enghoff commented Jul 4, 2018

Everything was working fine until this morning, I was running Firebase SDK 5.5.0 and upgrading to 5.5.1 hasn't resolved the issue. Unity version is 2017.4.3.

Is anyone else facing this issue?

@pronaypeddiraju
Copy link

I'm not sure if I we can pinpoint the problem but I suggest rolling back if that was stable unless you really need to utilize features from the 5.5.1 update

@enghoff
Copy link

enghoff commented Jul 4, 2018

@pronaypeddiraju actually the issue was present in 5.5.0 and was the reason for the reason for upgrade to 5.5.1, but the upgrade did not resolve the issue. I am still struggling to resolve this issue, if there are any logs or otherwise I can provide to help troubleshoot the issue, I'd be happy to provide this.

@enghoff
Copy link

enghoff commented Jul 4, 2018

Just adding a log of the failing Firebase initialisation -

07-05 00:48:59.824 27036-27062/? E/Unity: Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
07-05 00:48:59.882 27036-27062/? I/firebase: Firebase App initializing app com.jmm.couplegame (default 1).
07-05 00:48:59.888 27036-27062/? I/Unity: Firebase App initializing app com.jmm.couplegame (default 1).
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
07-05 00:48:59.893 27036-27062/? W/System.err: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.jmm.couplegame. Make sure to call FirebaseApp.initializeApp(Context) first.
        at com.google.firebase.FirebaseApp.getInstance(SourceFile:218)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:392)
        at android.os.Looper.loop(Looper.java:136)
        at com.unity3d.player.UnityPlayer$e.run(Unknown Source)
07-05 00:48:59.894 27036-27062/? E/firebase: new_app
07-05 00:48:59.894 27036-27062/? E/Unity: new_app
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
07-05 00:48:59.894 27036-27062/? E/firebase: Failed to initialize the default Firebase App.
07-05 00:48:59.967 27036-27062/? E/Unity: InitializationException:  Firebase app creation failed.
      at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <filename unknown>:0 
      at Firebase.FirebaseApp.Create () [0x00000] in <filename unknown>:0 
      at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0 
      at Firebase.Messaging.FirebaseMessaging+Listener..ctor () [0x00000] in <filename unknown>:0 
      at Firebase.Messaging.FirebaseMessaging+Listener.Create () [0x00000] in <filename unknown>:0 
      at Firebase.Messaging.FirebaseMessaging..cctor () [0x00000] in <filename unknown>:0 
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.Messaging.FirebaseMessaging
      at CoupleGame.FirebaseController.Start () [0x00000] in <filename unknown>:0 
     
    (Filename:  Line: -1)

@enghoff
Copy link

enghoff commented Jul 9, 2018

Update: the root cause turned out to be a clash between Firebase and another 3rd-party plugin, which both registered a provider in the AndroidManifest with android:authorities defined as the bundle id. The 3rd-party plugin was assigned a different handle, which resolved the initialisation failure.

@EvilNeru
Copy link

We just barely started getting this on our project bring Android development to a halt.
Host OS (OSX, Windows, Linux): Windows 10 Unity version: 2017.1.2p3 .NET version (3.5 or 4.6): to the following image Target platform: Android
@enghoff Is there anymore insight that you can add to how you solved this and what plugin in particular it was?

@enghoff
Copy link

enghoff commented Jul 11, 2018

just changed the android:authorities definition for the 3rd party component to ensure the definition was unique and not clashing with Firebase

@Crashthatch
Copy link

Crashthatch commented Jul 12, 2018

+1 I am also seeing this issue.

Windows 10, Unity 2018.1.3f1, building using gradle (through Unity), app running on Android Samsung Galaxy S8, running my app (not the quickstart) after adding Firebase-Analytics 5.1.1.

Relevant part of adb logcat:

07-13 00:01:51.936 21000 21130 I chatty  : uid=10426(u0_a426) keypoint.lift identical 2 lines
07-13 00:01:52.040 21000 21130 I native  : distribute.cc:92 No keypoints to prune.
07-13 00:01:52.139 21000 21130 I native  : distribute.cc:92 No keypoints to prune.
07-13 00:01:52.163 21000 21019 E Unity   : Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
07-13 00:01:52.184 21000 21019 W zygote  : Skipping duplicate class check due to unrecognized classloader
07-13 00:01:52.209 21000 21019 W zygote  : Skipping duplicate class check due to unrecognized classloader
07-13 00:01:52.218 21000 21019 I firebase: Firebase App initializing app com.arrowsd.horizonexplorer (default 1).
07-13 00:01:52.223 21000 21019 I Unity   : Firebase App initializing app com.arrowsd.horizonexplorer (default 1).
07-13 00:01:52.223 21000 21019 I Unity   :
07-13 00:01:52.223 21000 21019 I Unity   : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
07-13 00:01:52.223 21000 21019 I Unity   :
07-13 00:01:52.238 21000 21130 I native  : distribute.cc:92 No keypoints to prune.
07-13 00:01:52.242 21000 21019 W System.err: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.arrowsd.horizonexplorer. Make sure to call FirebaseApp.initializeApp(Context) first.
07-13 00:01:52.245 21000 21019 W System.err:    at com.google.firebase.FirebaseApp.getInstance(Unknown Source:56)
07-13 00:01:52.245 21000 21019 W System.err:    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
07-13 00:01:52.245 21000 21019 W System.err:    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
07-13 00:01:52.245 21000 21019 W System.err:    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
07-13 00:01:52.245 21000 21019 W System.err:    at android.os.MessageQueue.next(MessageQueue.java:394)
07-13 00:01:52.245 21000 21019 W System.err:    at android.os.Looper.loop(Looper.java:142)
07-13 00:01:52.245 21000 21019 W System.err:    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
07-13 00:01:52.245 21000 21019 E firebase: new_app
07-13 00:01:52.246 21000 21019 E Unity   : new_app
07-13 00:01:52.246 21000 21019 E Unity   :
07-13 00:01:52.246 21000 21019 E Unity   : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
07-13 00:01:52.246 21000 21019 E Unity   :
07-13 00:01:52.246 21000 21019 E firebase: Failed to initialize the default Firebase App.
07-13 00:01:52.268 21000 21019 E Unity   : InitializationException:  Firebase app creation failed.
07-13 00:01:52.268 21000 21019 E Unity   :   at Firebase.FirebaseApp.CreateAndTrack (Firebase.CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   :   at Firebase.FirebaseApp.Create () [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   :   at Firebase.FirebaseApp.get_DefaultInstance () [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   :   at Firebase.Analytics.FirebaseAnalytics..cctor () [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   : Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Firebase.Analytics.FirebaseAnalytics
07-13 00:01:52.268 21000 21019 E Unity   :   at CustomAnalytics.sendFirebaseCustomEvent (System.String eventName, IDictionary`2 parameters) [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   :   at CustomAnalytics.Update () [0x00000] in <filename unknown>:0
07-13 00:01:52.268 21000 21019 E Unity   :
07-13 00:01:52.268 21000 21019 E Unity   : (Filename:  Line: -1)
07-13 00:01:52.268 21000 21019 E Unity   :

Other installed plugins:

find ./Assets -regex ".*\.[aj]ar"

./Assets/GoogleARCore/SDK/Plugins/arcore_client.aar
./Assets/GoogleARCore/SDK/Plugins/google_ar_optional.aar
./Assets/GoogleARCore/SDK/Plugins/google_ar_required.aar
./Assets/GoogleARCore/SDK/Plugins/unityandroidpermissions.aar
./Assets/GoogleARCore/SDK/Plugins/unitygar.aar
./Assets/Mapbox/Core/Plugins/Android/mapbox-android-core-0.2.0.aar
./Assets/Mapbox/Core/Plugins/Android/mapbox-android-telemetry-3-1-4.aar
./Assets/Mapbox/Core/Plugins/Android/okhttp-3.8.0.jar
./Assets/Mapbox/Core/Plugins/Android/okio-1.13.0.jar
./Assets/Mapbox/Core/Plugins/Android/UniAndroidPermission/UniAndroidPermission_v1_2.jar
./Assets/Plugins/Android/android.arch.core.common-1.1.1.jar
./Assets/Plugins/Android/android.arch.core.runtime-1.1.1.aar
./Assets/Plugins/Android/android.arch.lifecycle.common-1.1.1.jar
./Assets/Plugins/Android/android.arch.lifecycle.extensions-1.1.1.aar
./Assets/Plugins/Android/android.arch.lifecycle.livedata-1.1.1.aar
./Assets/Plugins/Android/android.arch.lifecycle.livedata-core-1.1.1.aar
./Assets/Plugins/Android/android.arch.lifecycle.runtime-1.1.1.aar
./Assets/Plugins/Android/android.arch.lifecycle.viewmodel-1.1.1.aar
./Assets/Plugins/Android/ARCorePixelFix.jar
./Assets/Plugins/Android/com.android.support.animated-vector-drawable-26.1.0.aar
./Assets/Plugins/Android/com.android.support.appcompat-v7-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-annotations-26.1.0.jar
./Assets/Plugins/Android/com.android.support.support-compat-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-core-ui-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-core-utils-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-fragment-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-media-compat-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-v4-26.1.0.aar
./Assets/Plugins/Android/com.android.support.support-vector-drawable-26.1.0.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-ads-identifier-15.0.1.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-base-15.0.1.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-basement-15.0.1.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-measurement-base-16.0.0.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-stats-15.0.1.aar
./Assets/Plugins/Android/com.google.android.gms.play-services-tasks-15.0.1.aar
./Assets/Plugins/Android/com.google.code.gson.gson-2.8.2.jar
./Assets/Plugins/Android/com.google.firebase.firebase-analytics-16.0.1.aar
./Assets/Plugins/Android/com.google.firebase.firebase-analytics-impl-16.1.1.aar
./Assets/Plugins/Android/com.google.firebase.firebase-analytics-unity-5.1.1.aar
./Assets/Plugins/Android/com.google.firebase.firebase-app-unity-5.1.1.aar
./Assets/Plugins/Android/com.google.firebase.firebase-common-16.0.0.aar
./Assets/Plugins/Android/com.google.firebase.firebase-core-16.0.1.aar
./Assets/Plugins/Android/com.google.firebase.firebase-iid-16.2.0.aar
./Assets/Plugins/Android/com.google.firebase.firebase-iid-interop-16.0.0.aar
./Assets/Plugins/Android/com.google.firebase.firebase-measurement-connector-17.0.0.aar
./Assets/Plugins/Android/com.google.firebase.firebase-measurement-connector-impl-16.0.1.aar

The Failed to initialize the default Firebase App. / InitializationException: Firebase app creation failed. message repeats every time I try to log a custom event.

Also happens with firebase analytics 4.5.2.

I tried upgrading my Android SDK, but it did not help.

Ran the same apk on a Pixel device through Firebase Test Lab, and I see the same thing. Full trace: https://gist.github.com/Crashthatch/2dd569ce435ab0648aa1fc022cc6e206

When I remove firebase from my project, the CoreFoundation message goes away.

I'm out of things to try. I have no idea why Firebase on Android would be looking for an iOS CoreFoundation package. Without access to the firebase source the ball's pretty much in your court...

@stewartmiles
Copy link
Contributor

@Crashthatch have you reproduced this with one of our sample applications?

If you reproduce it with a sample and share it via our support channel we can take a look at what's going on.

@Crashthatch
Copy link

Crashthatch commented Jul 14, 2018

I tried to reproduce this with the sample application, and I do get the Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation error appearing in logcat, but it seems to function and I am able to send events etc. to Firebase without any problems, leading me to believe it's a red-herring.

If you want to reproduce anyway (to try to remove this confusing error message to avoid future confusion?), you can use this fork: https://github.com/Crashthatch/quickstart-unity (see commit log to see the exact steps I followed). Open and build & run in Unity 2018.1.3f1 (or use built apk in the git repo). Run adb logcat | grep CoreFoundation after running the app on a phone (I used my Samsung Galaxy S8) to see the "error" message. Commit Crashthatch@cadfe18 (before google-services.json was added or I made any code modifications) also shows the message, before complaining about not being able to find google-services.json / App ID.

The actual problem in my app (stack traces from a few lines below in the logcat above), Default FirebaseApp is not initialized in this process & Failed to initialize the default Firebase App actually seem to happen when I add a dependency on android.arch.lifecycle:extensions:1.1.1 (adding other dependencies is fine). I'll open a separate issue for that.

@enghoff
Copy link

enghoff commented Jul 15, 2018

Just fyi, I also still see the Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation error after the core initialisation issue was resolved; this does not appear to be a critical error

@stewartmiles
Copy link
Contributor

@enghoff & @Crashthatch the CoreFoundation error message is actually intentional. We detect whether we need to apply a workaround for a Unity networking bug on OSX by searching for the presence of this non-existent framework. The error pops up as the pinvoke we use fails, we catch the exception and apply the workaround if it's required. The only reason this code is still in our code base is due to our use of Unity's .NET networking stack in the real-time database, so we've removed the code path in upcoming mobile builds. Once we've finished migration of the RT DB to our native desktop implementation this code will disappear entirely.

@Crashthatch
Copy link

Crashthatch commented Jul 17, 2018

Great! Perhaps make it an INFO, or change it to something that looks less like an error (CoreFoundation not found, no need for workaround) or log another message afterwards saying it's benign, if it's going to be a long time before that happens? Although maybe this thread will pop up when future people search and they won't waste as much time as I did.

If the change is imminent, then no need. :)

@stewartmiles
Copy link
Contributor

@Crashthatch the error is thrown by the mono framework so we can't change the log level unfortunately.

@mykidocoder
Copy link

Please mention that it's important to KEEP ALL THE IMPORTED FOLDERS UNTOUCHED, by moving any of them will fail in endless ways.. so hardcoded..

@firebase firebase locked and limited conversation to collaborators Oct 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests