firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
821 stars 425 forks source link

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

Closed superbybot closed 6 years ago

superbybot commented 6 years ago

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 commented 6 years ago

Similar stackoverflow issue: https://stackoverflow.com/questions/48624424/unable-to-find-corefoundation?newreg=2dd20530e9d3427095c5e557d6b86048

stewartmiles commented 6 years ago

@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 commented 6 years ago

@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?

Cheers, Stewart

johnb003 commented 6 years ago

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 commented 6 years ago

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

DooblyNoobly commented 6 years ago

@johnb003 please reopen this is not fixed

huy2607 commented 6 years ago

Anyone can fix this ?

DooblyNoobly commented 6 years ago

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 commented 6 years ago

i crash everytime i log event by firebase

huy2607 commented 6 years ago

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_CreateInternalSWIG_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_CreateInternalSWIG_0() Firebase.FirebaseApp:CreateInternal() Firebase.FirebaseApp:m0() 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:m0() Firebase.FirebaseApp:CreateAndTrack(CreateDelegate) Firebase.FirebaseApp:Create() Firebase.FirebaseApp:get_DefaultInstance() Firebase.Analytics.FirebaseAnalytics:.cctor()

DooblyNoobly commented 6 years ago

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

johnb003 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

i did you suggest but still crash @DooblyNoobly !

johnb003 commented 6 years ago

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 commented 6 years ago

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

stewartmiles commented 6 years ago

@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 commented 6 years ago

@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 : #01 pc 00047f93 /system/lib/libc.so (pthread_kill+34) 04-12 07:51:52.356 27133 27133 F DEBUG : #02 pc 0001daad /system/lib/libc.so (raise+10) 04-12 07:51:52.356 27133 27133 F DEBUG : #03 pc 00019231 /system/lib/libc.so (libc_android_abort+34) 04-12 07:51:52.356 27133 27133 F DEBUG : #04 pc 0001714c /system/lib/libc.so (abort+4) 04-12 07:51:52.356 27133 27133 F DEBUG : #05 pc 00318b4d /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252) 04-12 07:51:52.356 27133 27133 F DEBUG : #06 pc 000b4ac1 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+864) 04-12 07:51:52.356 27133 27133 F DEBUG : #07 pc 00238a95 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+1664) 04-12 07:51:52.356 27133 27133 F DEBUG : #08 pc 00238c87 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9va_list+58) 04-12 07:51:52.356 27133 27133 F DEBUG : #09 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_jmethodIDSt9va_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_GLOBALN_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 04-12 07:51:54.183 3680 27134 W ActivityManager: Force finishing activity

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

MartinGonzalez commented 6 years ago

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 commented 6 years ago

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

stewartmiles commented 6 years ago

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 commented 6 years ago

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:

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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.

danielandujar commented 6 years ago

too long to post here... any email address?

danielandujar commented 6 years ago

debug_log.txt

stewartmiles commented 6 years ago

Thanks @blackknigt . Well this should definitely not be crashing, instead it should now simply be throwing a C# exception. At least you should be able to resolve this now.

04-18 19:10:58.517 12746 12766 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-18 19:10:58.517 12746 12766 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) 04-18 19:10:58.517 12746 12766 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) 04-18 19:10:58.517 12746 12766 I Unity : UnityEngine.Logger:Log(LogType, Object) 04-18 19:10:58.517 12746 12766 I Unity : UnityEngine.Debug:Log(Object) 04-18 19:10:58.517 12746 12766 I Unity : Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String) 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:LogMessage(LogLevel, String) 04-18 19:10:58.517 12746 12766 I Unity : Firebase.AppUtilPINVOKE:FirebaseApp_CreateInternal__SWIG_0() 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:CreateInternal() 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:<Create>m__0() 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp) 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:Create() 04-18 19:10:58.517 12746 12766 I Unity : Firebase.FirebaseApp:get_DefaultInstance() 04-18 19:10:58.517 12746 12766 I Unity : Firebase.Auth.FirebaseAuth:get_DefaultInstance() 04-18 19:10:58.517 12746 12766 I Unity : FirebaseUtils:Init() (at /Users/mrdan/Desktop/AndujarDev/Unity/SfxFun/Assets/Scripts/FirebaseUtils.cs:23) 04-18 19:10:58.517 12746 12766 I Unity : GameController:Start() (at /Users/mrdan/Desktop/AndujarDev/Unity/SfxFun/Assets/Scripts/GameControll 04-18 19:10:58.548 3680 4192 D ActivityManager: cleanUpApplicationRecord -- 12869 04-18 19:10:58.603 3680 4806 I ActivityManager: Start proc 13612:com.google.android.partnersetup/u0a32 for broadcast com.google.android.partnersetup/.RlzPingBroadcastReceiver 04-18 19:10:58.782 3680 4879 I ActivityManager: DSS on for com.google.android.partnersetup and scale is 1.0 04-18 19:10:58.889 13632 13632 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-18 19:10:58.889 13632 13632 F DEBUG : Build fingerprint: 'samsung/dream2ltexx/dream2lte:7.0/NRD90M/G955FXXU1AQF7:user/release-keys' 04-18 19:10:58.889 13632 13632 F DEBUG : Revision: '10' 04-18 19:10:58.889 13632 13632 F DEBUG : ABI: 'arm' 04-18 19:10:58.890 13632 13632 F DEBUG : pid: 12746, tid: 12766, name: UnityMain >>> com.cry.sfxfun <<< 04-18 19:10:58.890 13632 13632 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 04-18 19:10:58.893 13632 13632 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 19:10:58.893 13632 13632 F DEBUG : r0 00000000 r1 000031de r2 00000006 r3 00000008 04-18 19:10:58.893 13632 13632 F DEBUG : r4 d23ff978 r5 00000006 r6 d23ff920 r7 0000010c 04-18 19:10:58.893 13632 13632 F DEBUG : r8 00000000 r9 f2669e84 sl 00000f75 fp f262f63f 04-18 19:10:58.893 13632 13632 F DEBUG : ip 0000000b sp d23fd7a8 lr f467af97 pc f467d7f4 cpsr 200f0010 04-18 19:10:58.912 13632 13632 F DEBUG : 04-18 19:10:58.912 13632 13632 F DEBUG : backtrace: 04-18 19:10:58.912 13632 13632 F DEBUG : #00 pc 0004a7f4 /system/lib/libc.so (tgkill+12) 04-18 19:10:58.912 13632 13632 F DEBUG : #01 pc 00047f93 /system/lib/libc.so (pthread_kill+34) 04-18 19:10:58.916 13632 13632 F DEBUG : #02 pc 0001daad /system/lib/libc.so (raise+10) 04-18 19:10:58.916 13632 13632 F DEBUG : #03 pc 00019231 /system/lib/libc.so (__libc_android_abort+34) 04-18 19:10:58.916 13632 13632 F DEBUG : #04 pc 0001714c /system/lib/libc.so (abort+4) 04-18 19:10:58.916 13632 13632 F DEBUG : #05 pc 00318b4d /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252) 04-18 19:10:58.916 13632 13632 F DEBUG : #06 pc 000b4ac1 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+864) 04-18 19:10:58.916 13632 13632 F DEBUG : #07 pc 00238a95 /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1664) 04-18 19:10:58.916 13632 13632 F DEBUG : #08 pc 00238c87 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58) 04-18 19:10:58.916 13632 13632 F DEBUG : #09 pc 000ca46b /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46) 04-18 19:10:58.916 13632 13632 F DEBUG : #10 pc 000ca057 /system/lib/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+362) 04-18 19:10:58.916 13632 13632 F DEBUG : #11 pc 000c906f /system/lib/libart.so (_ZN3art11ScopedCheck22CheckPossibleHeapValueERNS_18ScopedObjectAccessEcNS_12JniValueTypeE+26) 04-18 19:10:58.916 13632 13632 F DEBUG : #12 pc 000c854b /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+802) 04-18 19:10:58.916 13632 13632 F DEBUG : #13 pc 000cc6f7 /system/lib/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+114) 04-18 19:10:58.916 13632 13632 F DEBUG : #14 pc 000cbd25 /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+512) 04-18 19:10:58.916 13632 13632 F DEBUG : #15 pc 000c155f /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+42) 04-18 19:10:58.916 13632 13632 F DEBUG : #16 pc 000b0513 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18) 04-18 19:10:58.916 13632 13632 F DEBUG : #17 pc 000f7c21 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN8firebase12_GLOBAL__N_1L21CreateFirebaseOptionsEP7_JNIEnvRKNS_10AppOptionsE+220) 04-18 19:10:58.917 13632 13632 F DEBUG : #18 pc 000f7653 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN8firebase3App6CreateERKNS_10AppOptionsEPKcP7_JNIEnvP8_jobject+594) 04-18 19:10:58.917 13632 13632 F DEBUG : #19 pc 000a77f3 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN8firebase3App6CreateEP7_JNIEnvP8_jobject+18) 04-18 19:10:58.917 13632 13632 F DEBUG : #20 pc 000a7385 /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN8firebaseL9AppCreateEPKNS_10AppOptionsEPKc+68) 04-18 19:10:58.917 13632 13632 F DEBUG : #21 pc 000a731b /data/app/com.cry.sfxfun-1/lib/arm/libApp-4.5.1.so (_ZN8firebaseL21AppGetDefaultInstanceEPKNS_10AppOptionsE+26) 04-18 19:10:58.917 13632 13632 F DEBUG : #22 pc 0000f3d4 <anonymous:c8015000>

As you can see from the first line of this error message the problem you're running into 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. . This suggests that you either did not include a google-services.json in your project that provides the config for the Firebase SDK to connect to the project you've set up in the console or that the conversion of the google-services.json config file to Plugins/Android/Firebase/res/values/google-services.xml failed or didn't get to run due to other errors in your project. I recommend:

danielandujar commented 6 years ago

i have the google-services.json... should it be anywhere specific?

danielandujar commented 6 years ago
screen shot 2018-04-18 at 8 22 46 pm
stewartmiles commented 6 years ago

As described in https://firebase.google.com/docs/unity/setup#add_the_sdk_to_your_app and https://firebase.google.com/docs/unity/setup#add_the_sdk_to_your_app_2 this should be in a folder in your Unity project. However, it sounds like "in your Unity project" isn't that clear since we mean in any folder under the Assets directory, i.e you're in the Unity editor and you add it to the project there. Make sense? Do we need to clarify the docs?

danielandujar commented 6 years ago

a whole week lost because the json should have been inside assets.... ... not funny. And yes, the docs should have specified at least the root folder to add in.

stewartmiles commented 6 years ago

@blackknigt we'll update the docs, what would make more sense to you?

danielandujar commented 6 years ago

Somewhere in the Assets Folder

On Wed, Apr 18, 2018, 8:45 PM Stewart Miles notifications@github.com wrote:

@blackknigt https://github.com/blackknigt we'll update the docs, what would make more sense to you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/136#issuecomment-382573295, or mute the thread https://github.com/notifications/unsubscribe-auth/AM_w6_VxEmZGR8X4ODGfhaYPEoqq-M_zks5tp94QgaJpZM4R6yS3 .

stewartmiles commented 6 years ago

@blackknigt thanks for the feedback, we'll get our docs updated. I noticed while reviewing the readmes in this project that it's a little vague about where config files should be placed as well so we'll update them as well.

@superbybot @MartinGonzalez @DooblyNoobly @huy2607 was the issue resolved for you?

If not, could you try the following:

  1. Make sure your google-services.json and GoogleService-Info.plist are under the Assets directory within your project.
  2. Upgrade your project(s) to the 4.5.1 plugin(s) see https://firebase.google.com/docs/unity/setup
  3. Download and unpack the attached issue136patch1.zip into Assets/Firebase/Plugins (you should be replacing the existing Firebase.App.dll and Firebase.Platform.dll)
  4. Give it a try
  5. Provide feedback on this thread
dday1987 commented 6 years ago

I've done everything up to issue 136 patch 1. It stays the same. fireabse 3.0.3 -> fireabse 4.5.0 or 4.5.1 I upgraded. All the old files were deleted. There was no problem before that.

google-services.json re download and Force Resolve windows10 64x, unity 5.6.5p4 or 5.6.5p3 FacebookSDK 7.11.1 (Resolver_v1.2.64.0 Use Firebase4.5.1) Build AndroidTarget Mono2x(Gradle(New)) jdk1.8.0_161 FAT(ARMv7+ ARM64) SDK BuildTools27.0.3(before All Install) SDK TOOLS 26.1.1

1

TestDevice Amazon KFGIWI Android 5.1.1 API 22, Samsung SM-T820 Android 7.0 API24 3

stewartmiles commented 6 years ago

@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 commented 6 years ago

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 https://github.com/firebase/quickstart-unity/issues/136#issuecomment-382771038 . 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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

hieupt1289 commented 6 years ago

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

pronaypeddiraju commented 6 years ago

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

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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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