firebase / quickstart-unity

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

Can't get Crashlytics or Analytics to work #792

Closed jlubeck closed 3 years ago

jlubeck commented 3 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Steps to reproduce:

I follow Getting Started guides and also checked the example projects here and ended up with this code:

    public virtual void Start()
    {
        Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug;
        FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
        {
            dependencyStatus = task.Result;
            if (dependencyStatus == DependencyStatus.Available)
            {
                InitializeFirebase();
                Debug.Log("Firebase ready to use");
            }
            else
            {
                Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    }

    // Handle initialization of the necessary firebase modules:
    void InitializeFirebase()
    {
        var app = FirebaseApp.DefaultInstance;
        FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
        firebaseInitialized = true;
        Firebase.Analytics.FirebaseAnalytics.LogEvent(Firebase.Analytics.FirebaseAnalytics.EventAppOpen);
        throw new System.Exception("test exception please ignore");
    }

The i compiled the app and ran it on a physical device and these are my logs:

CrashReporter: initialized
2020-09-24 14:02:02.975958-0400 Nodeshifter[765:116506] Built from 'trunk' branch, Version '2020.2.0b2 (90b2443a8df1)', Build type 'Release', Scripting Backend 'il2cpp'
-> applicationDidFinishLaunching()
Loading player data from /private/var/containers/Bundle/Application/BD399514-47CD-4C83-AA49-B792C44B8C5C/Nodeshifter.app/Data/data.unity3d
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A10 GPU
Initialize engine version: 2020.2.0b2 (90b2443a8df1)
2020-09-24 14:02:03.576377-0400 Nodeshifter[765:116755] 6.24.0 - <AppMeasurement>[I-ACS031025] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
<UnityPortraitOnlyViewController: 0x1031485a0>

2020-09-24 14:02:03.940088-0400 Nodeshifter[765:116506] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x103253cf0>.
2020-09-24 14:02:04.135576-0400 Nodeshifter[765:116768] 6.24.0 - <AppMeasurement>[I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
UnloadTime: 2.122875 ms

2020-09-24 14:02:08.365879-0400 Nodeshifter[765:116506] DEBUG: Disabling all app initializers
2020-09-24 14:02:08.365993-0400 Nodeshifter[765:116506] DEBUG: Disable analytics
Enable module 'analytics' for 'Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics'

2020-09-24 14:02:08.366420-0400 Nodeshifter[765:116506] DEBUG: analytics app initializer Enabling
2020-09-24 14:02:08.366533-0400 Nodeshifter[765:116506] DEBUG: App initializer auth not found, failed to enable.
2020-09-24 14:02:08.366597-0400 Nodeshifter[765:116506] DEBUG: App initializer crashlytics not found, failed to enable.
2020-09-24 14:02:08.366657-0400 Nodeshifter[765:116506] DEBUG: App initializer database not found, failed to enable.
2020-09-24 14:02:08.366801-0400 Nodeshifter[765:116506] DEBUG: App initializer dynamic_links not found, failed to enable.
2020-09-24 14:02:08.366861-0400 Nodeshifter[765:116506] DEBUG: App initializer functions not found, failed to enable.
2020-09-24 14:02:08.367104-0400 Nodeshifter[765:116506] DEBUG: App initializer instance_id not found, failed to enable.
2020-09-24 14:02:08.367187-0400 Nodeshifter[765:116506] DEBUG: App initializer invites not found, failed to enable.
2020-09-24 14:02:08.367323-0400 Nodeshifter[765:116506] DEBUG: App initializer messaging not found, failed to enable.
2020-09-24 14:02:08.367589-0400 Nodeshifter[765:116506] DEBUG: App initializer performance not found, failed to enable.
2020-09-24 14:02:08.367683-0400 Nodeshifter[765:116506] DEBUG: App initializer remote_config not found, failed to enable.
2020-09-24 14:02:08.367755-0400 Nodeshifter[765:116506] DEBUG: App initializer storage not found, failed to enable.
2020-09-24 14:02:08.367844-0400 Nodeshifter[765:116506] DEBUG: App initializer test_lab not found, failed to enable.

2020-09-24 14:02:08.376403-0400 Nodeshifter[765:116506] DEBUG: Creating Firebase App __FIRAPP_DEFAULT for Firebase C++ 6.15.1
2020-09-24 14:02:08.382573-0400 Nodeshifter[765:116506] [Firebase/Crashlytics] Version 4.1.0
2020-09-24 14:02:08.394312-0400 Nodeshifter[765:116506] DEBUG: Added app name=__FIRAPP_DEFAULT: options, api_key=AIzaSyC7bk7AKhtOnNtR1zI5Rwl2n6gtmt3lqm8, app_id=1:1057174381533:ios:287efeb2ccead21d, database_url=https://nodeshifter.firebaseio.com, messaging_sender_id=1057174381533, storage_bucket=nodeshifter.appspot.com, project_id=nodeshifter (0x1e2920f0)

2020-09-24 14:02:08.537627-0400 Nodeshifter[765:116788] 6.24.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2020-09-24 14:02:08.662842-0400 Nodeshifter[765:116788] 6.24.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60500000 started
2020-09-24 14:02:08.664304-0400 Nodeshifter[765:116788] 6.24.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
Setting up 1 worker threads for Enlighten.
  Thread -> id: 16e9bf000 -> priority: 1 
2020-09-24 14:02:10.038942-0400 Nodeshifter[765:116788] 6.24.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2020-09-24 14:02:10.054248-0400 Nodeshifter[765:116788] 6.24.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2020-09-24 14:02:10.157746-0400 Nodeshifter[765:116760] 6.24.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled

So as you can see it's weird, in some areas it says it's setup, but others says it's not ready. And in my console, I'm still seeing this:

Screen Shot 2020-09-24 at 2 13 14 PM

And on the live StreamView i see nothing.

Is there anything else I'm missing?

jlubeck commented 3 years ago

I was able to make Analytics work by using -FIRDebugEnabled. So I assume that was just a timing issue with non debugging devices.

I'm still unable to get Crashlytics to receive an event though

patm1987 commented 3 years ago

Hi, thanks for reporting an issue.

For your first bit - analytics does take a bit of time to propagate. You'll likely see one user within minutes of first adding Firebase, but events take time to propagate (they'll usually get batched every hour, and your first report will happen after 24 hours. Debug mode just forces them to upload immediately and populates DebugView in your console).

For Crashlytics, can I have you try one thing? Crash reports are only sent up on the next run of your game. So if an exception is recording this run, you need to quit your game and relaunch it without reinstalling. This means that you'll want to exit your game via the multitasking menu on iOS then relaunch it from springboard (not via XCode). If you trigger an exception, quit your game, and relaunch it entirely within iOS and Crashlytics doesn't update within a few minutes then there is a deeper issue that we should look into!

jlubeck commented 3 years ago

Hey @patm1987 I tried what you told me, but still not seeing anything in the console. I also tried running the app without compiling, and this is what I see in the logs:

CrashReporter: initialized
2020-09-28 11:27:05.496787-0400 Nodeshifter[467:112986] DEBUG: App initializer crashlytics not found, failed to enable.
  at CrashlyticsTester.throwExceptionEvery60Updates () [0x00000] in <00000000000000000000000000000000>:0 
2020-09-28 11:27:05.544072-0400 Nodeshifter[467:112986] [Firebase/Crashlytics] Version 4.1.0
2020-09-28 11:27:05.620128-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPad6,8, 13.3.1 (17D50)
2020-09-28 11:27:05.620481-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
2020-09-28 11:27:05.620621-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
2020-09-28 11:27:05.620763-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] Unsent reports will be uploaded at startup
  at CrashlyticsTester.throwExceptionEvery60Updates () [0x00000] in <00000000000000000000000000000000>:0 
  at CrashlyticsTester.throwExceptionEvery60Updates () [0x00000] in <00000000000000000000000000000000>:0 
  at CrashlyticsTester.throwExceptionEvery60Updates () [0x00000] in <00000000000000000000000000000000>:0 

The last 3 lines are examples of me crashing the app.

Looks like I'm also not the only one having an issue with crashlytics: https://github.com/firebase/quickstart-unity/issues/798

cynthiajoan commented 3 years ago

Hi @jlubeck, from your log I see this line: DEBUG: App initializer crashlytics not found, failed to enable. This indicates you might not have the crashlytics sdk installed correctly. Can you double check your project has the following files under Assets->Firebase->Plugins->iOS?

Screen Shot 2020-10-01 at 5 52 59 PM
jlubeck commented 3 years ago

Hi @cynthiajoan thank you for your reply. I did see that message which thought it was strange. But right below it you can also see:

2020-09-28 11:27:05.620128-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iPad6,8, 13.3.1 (17D50)
2020-09-28 11:27:05.620481-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Crash:Reports:Event] Registered Firebase Analytics event listener
2020-09-28 11:27:05.620621-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
2020-09-28 11:27:05.620763-0400 Nodeshifter[467:113222] 6.29.0 - [Firebase/Crashlytics][I-CLS000000] Unsent reports will be uploaded at startup

I don't have those files there, but I'm guessing it's because I installed through the package manager. I have them here:

Screen Shot 2020-10-01 at 10 07 27 PM Screen Shot 2020-10-01 at 10 07 34 PM
chkuang-g commented 3 years ago

Hi @jlubeck

Here is what I tried:

I think if you throw an exception in C# level, Unity usually captures it and prevents a fatal crash.

Could you try the quickstart and verify if you can see those non-fatal issues?

Shawn

kmkho commented 3 years ago

I am also using Firebase SDK 6.15.2 through UPM, Unity 2019.4.11f1, and events are not appearing in my console for iOS. I had the same issue for Android, but was able to fix it thanks to this thread: https://github.com/firebase/quickstart-unity/issues/798. The Android problem was that 6.15.2 includes Crashlytics 17.0.0, but the console wants 17.1.1. I think iOS has the same issue: 6.15.2 includes Crashlytics 4.1.0 but wants 4.3.0 (as stated in that green box on the console page). The fix for Android was to add crashlytics 17.1.1 to a Dependencies.xml under an Editor folder. Is there a similar workaround for iOS?

chkuang-g commented 3 years ago

@kmkho

In Unity SDK 6.16.0, we did bump up FirebaseCrashlytics Pod version to 4.6.1. However, we are going to bump up Android SDK version to 17.2.2 only in the next patch release. I think it is safe to bump up yourself manually to 17.1.1 but not above, as mentioned here.

chkuang-g commented 3 years ago

Seems like there was some issue with Crashlytics backend and should be resolved now. https://github.com/firebase/quickstart-unity/issues/798#issuecomment-712446848

chkuang-g commented 3 years ago

FYI, we released 6.16.1 which is using Crashlytics Android SDK 17.2.2 now

google-oss-bot commented 3 years ago

Hey @jlubeck. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

jlubeck commented 3 years ago

Hi @jlubeck

Here is what I tried:

Screen Shot 2020-10-16 at 6 16 39 PM

I think if you throw an exception in C# level, Unity usually captures it and prevents a fatal crash.

Could you try the quickstart and verify if you can see those non-fatal issues?

Shawn

I still can't get the console to change that initial screen. Doesn't look like anything is being sent, even following all this to the letter.

I upgraded Firebase to the latest version (6.16.1) I have this on my Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'AppsFlyerFramework', '6.0.7'
  pod 'Firebase/Analytics', '6.32.2'
  pod 'Firebase/Core', '6.32.2'
  pod 'Firebase/Crashlytics', '6.32.2'
end

And these are my latest logs AFTER crashing, AFTER killing the app and AFTER reopening

2020-10-29 17:29:22.477919-0400 Nodeshifter[4617:1787584]  - <AppMeasurement>[I-ACS036001] Analytics screen reporting is disabled. UIViewController transitions will not be logged.
CrashReporter: initialized
2020-10-29 17:29:23.144813-0400 Nodeshifter[4617:1787092] Built from '2020.2/staging' branch, Version '2020.2.0b8 (dff91d65251a)', Build type 'Release', Scripting Backend 'il2cpp'
-> applicationDidFinishLaunching()
2020-10-29 17:29:25.949695-0400 Nodeshifter[4617:1787092] got didFinishLaunching = (null)
-> applicationDidBecomeActive()
2020-10-29 17:29:25.951151-0400 Nodeshifter[4617:1787092] got didBecomeActive(out) = (null)
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A10 GPU
Initialize engine version: 2020.2.0b8 (dff91d65251a)
2020-10-29 17:29:27.284851-0400 Nodeshifter[4617:1787092] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x13de5ccc0>.
UnloadTime: 0.684250 ms

2020-10-29 17:29:29.750237-0400 Nodeshifter[4617:1787092] DEBUG: Disabling all app initializers
2020-10-29 17:29:29.750366-0400 Nodeshifter[4617:1787092] DEBUG: Disable analytics
Enable module 'analytics' for 'Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics'

2020-10-29 17:29:29.750546-0400 Nodeshifter[4617:1787092] DEBUG: analytics app initializer Enabling
2020-10-29 17:29:29.750613-0400 Nodeshifter[4617:1787092] DEBUG: App initializer auth not found, failed to enable.
2020-10-29 17:29:29.750675-0400 Nodeshifter[4617:1787092] DEBUG: App initializer crashlytics not found, failed to enable.
2020-10-29 17:29:29.750741-0400 Nodeshifter[4617:1787092] DEBUG: App initializer database not found, failed to enable.
2020-10-29 17:29:29.750832-0400 Nodeshifter[4617:1787092] DEBUG: App initializer dynamic_links not found, failed to enable.
2020-10-29 17:29:29.751352-0400 Nodeshifter[4617:1787092] DEBUG: App initializer functions not found, failed to enable.
2020-10-29 17:29:29.751426-0400 Nodeshifter[4617:1787092] DEBUG: App initializer instance_id not found, failed to enable.
2020-10-29 17:29:29.751499-0400 Nodeshifter[4617:1787092] DEBUG: App initializer invites not found, failed to enable.
2020-10-29 17:29:29.751565-0400 Nodeshifter[4617:1787092] DEBUG: App initializer messaging not found, failed to enable.
2020-10-29 17:29:29.751626-0400 Nodeshifter[4617:1787092] DEBUG: App initializer performance not found, failed to enable.
2020-10-29 17:29:29.751686-0400 Nodeshifter[4617:1787092] DEBUG: App initializer remote_config not found, failed to enable.
2020-10-29 17:29:29.751860-0400 Nodeshifter[4617:1787092] DEBUG: App initializer storage not found, failed to enable.
2020-10-29 17:29:29.751948-0400 Nodeshifter[4617:1787092] DEBUG: App initializer test_lab not found, failed to enable.
AppsFlyer SDK version 6.0.7 started build (7);
2020-10-29 17:29:29.772418-0400 Nodeshifter[4617:1787092] DEBUG: Creating Firebase App __FIRAPP_DEFAULT for Firebase C++ 6.16.1
2020-10-29 17:29:29.778277-0400 Nodeshifter[4617:1787569] 6.32.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2020-10-29 17:29:29.780326-0400 Nodeshifter[4617:1787092] [Firebase/Crashlytics] Version 4.6.2
2020-10-29 17:29:29.834467-0400 Nodeshifter[4617:1787092] DEBUG: Added app name=__FIRAPP_DEFAULT: options, api_key=AIzaSyC7bk7AKl2n6gtmt3lqm8, app_id=1:1057174533:ios:287efeb2c21d, database_url=https://nodeshifter.firebaseio.com, messaging_sender_id=105717533, storage_bucket=nodeshifter.appspot.com, project_id=nodeshifter (0x414e5f30)
Firebase ready to use

Setting up 1 worker threads for Enlighten.
  Thread -> id: 16f3ef000 -> priority: 1 

2020-10-29 17:29:30.279383-0400 Nodeshifter[4617:1787583] 6.32.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2020-10-29 17:29:30.279928-0400 Nodeshifter[4617:1787583] 6.32.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60802000 started
2020-10-29 17:29:30.280412-0400 Nodeshifter[4617:1787583] 6.32.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
Loaded 6 locales. Active locale English (en)

2020-10-29 17:29:30.367994-0400 Nodeshifter[4617:1787727] 6.32.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2020-10-29 17:29:30.383798-0400 Nodeshifter[4617:1787727] 6.32.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2020-10-29 17:29:30.386311-0400 Nodeshifter[4617:1787727] 6.32.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled

AppsFlyer_Unity_v6.0.7 didReceiveConversionData called with {"adset":null,"click_time":"2020-10-26 21:33:15.508","af_sub2":null,"esp_name":null,"is_branded_link":null,"af_status":"Non-organic","af_siteid":null,"ts":"1603747977","agency":null,"http_referrer":null,"af_cpi":null,"af_sub1":null,"campaign":"None","cost_cents_USD":"0","is_universal_link":null,"install_time":"2020-10-26 21:36:18.762","adgroup":null,"iscache":true,"af_sub5":null,"idfa":"F9728CFB-C26B-4C58-8530","af_click_lookback":"7d","af_r":"http:\/\/sdktest.appsflyer.com\/sdk-integration-test\/install\/launch?sid=f8fe61a7-c1e3-4592-8d4f","adset_id":null,"adgroup_id":null,"media_source":"appsflyer_sdk_test_int","clickid":"f8fe61a7-c1e3-4592-8d4f","engmnt_source":null,"af_sub4":null,"is_first_launch":false,"campaign_id":null,"redirect_response_data":null,"orig_cost":"0.0","match_type":"id_matching","af_sub3":null,"retargeting_conversion_type":"none"}

-> applicationWillResignActive()
-> applicationDidEnterBackground()
2020-10-29 17:29:31.905163-0400 Nodeshifter[4617:1787092] got didEnterBackground = (null)
["$s7Combine10PublishersO8SequenceV7receive10subscriberyqd___t7FailureQyd__Rs_AA10SubscriberRd__5InputQyd__7ElementRtzlF +752", "$s7Combine9PublisherPAAE9subscribeyyqd__AA10SubscriberRd__7FailureQyd__AFRtz5InputQyd__6OutputRtzlF +932", "CFRunLoopRunSpecific +572", "GSEventRunModal +160", "UIApplicationMain +164", "-[UnityFramework runUIApplicationMainWithArgc:argv:] +108", "main +68"]
["$s7Combine10PublishersO8SequenceV7receive10subscriberyqd___t7FailureQyd__Rs_AA10SubscriberRd__5InputQyd__7ElementRtzlF +752", "$s7Combine9PublisherPAAE9subscribeyyqd__AA10SubscriberRd__7FailureQyd__AFRtz5InputQyd__6OutputRtzlF +932", "CFRunLoopRunSpecific +572", "GSEventRunModal +160", "UIApplicationMain +164", "-[UnityFramework runUIApplicationMainWithArgc:argv:] +108", "main +68"]

FYI, this is what I get when I force a crash:

Causing a platform crash.

InvalidOperationException: Uncaught exception created from UI.
  at LevelManager.ThrowUncaughtException () [0x00000] in <00000000000000000000000000000000>:0 
  at LevelManager.LoadLevel (System.String name) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (T1 handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()

["$s7Combine10PublishersO8SequenceV7receive10subscriberyqd___t7FailureQyd__Rs_AA10SubscriberRd__5InputQyd__7ElementRtzlF +752", "$s7Combine9PublisherPAAE9subscribeyyqd__AA10SubscriberRd__7FailureQyd__AFRtz5InputQyd__6OutputRtzlF +932", "CFRunLoopRunSpecific +572", "GSEventRunModal +160", "UIApplicationMain +164", "-[UnityFramework runUIApplicationMainWithArgc:argv:] +108", "main +68"]
pistoleta commented 3 years ago

Just one question, It seems I've made it work on my iOS device following your instructions. But I don't seem to be able to make it work on Unity Editor. I guess it's not supported, is this correct?

Console: Disabling all app initializers Disable analytics Disable auth Disable crashlytics Disable database Disable dynamic_links Disable functions Disable instance_id Disable messaging Disable remote_config Disable storage Enable module 'analytics' for 'Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics' analytics app initializer Enabling Enable module 'auth' for 'Firebase.Auth.FirebaseAuth, Firebase.Auth' auth app initializer Enabling crashlytics app initializer Disabling Enable module 'database' for 'Firebase.Database.FirebaseDatabase, Firebase.Database' database app initializer Enabling dynamic_links app initializer Disabling Enable module 'functions' for 'Firebase.Functions.FirebaseFunctions, Firebase.Functions' functions app initializer Enabling instance_id app initializer Disabling App initializer invites not found, failed to enable. messaging app initializer Disabling App initializer performance not found, failed to enable. remote_config app initializer Disabling Enable module 'storage' for 'Firebase.Storage.FirebaseStorage, Firebase.Storage' storage app initializer Enabling App initializer test_lab not found, failed to enable. Creating Firebase App __FIRAPP_DEFAULT for Firebase C++ 6.16.1 Added app name=__F (0x09faf6d0) Did not register exception handlers: Crashlytics SDK was not initialized Disabling all app initializers Disable analytics Disable auth Disable crashlytics Disable database Disable dynamic_links Disable functions Disable instance_id Disable messaging Disable remote_config Disable storage

patm1987 commented 3 years ago

This is correct, neither Crashlytics nor Analytics have desktop support (see this matrix). All calls into these SDKs will silently no-op to avoid crashing the Unity Editor.

patm1987 commented 3 years ago

With the šŸ‘, let me know if the issue is resolved.

jlubeck commented 3 years ago

With the šŸ‘, let me know if the issue is resolved.

No, not for me. I added quite a bit more info on my last comment here https://github.com/firebase/quickstart-unity/issues/792#issuecomment-719038717

chkuang-g commented 3 years ago

@jlubeck

I think I know what is going on here. The key is that you throw the exception within the continuation function of ContinueWithOnMainThread().

If any exception is thrown in the continuation function, the exception will be stored in the task it returns.

Try this:

    public virtual void Start() {
      FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
        dependencyStatus = task.Result;
        if (dependencyStatus == DependencyStatus.Available) {
          InitializeFirebase();
        } else {
          Debug.LogError(
            "Could not resolve all Firebase dependencies: " + dependencyStatus);
        }
      }).ContinueWithOnMainThread(task => {
          if (task.IsFaulted) {
              Debug.LogException(task.Exception);
          }
      }).ContinueWith(task => {
        Debug.LogWarning("Throw an exception from a non-main thread.");
        throw new System.Exception("An exception from a non-main thread");
      }).ContinueWithOnMainThread(task => {
          if (task.IsFaulted) {
              Debug.LogException(task.Exception);
          }
      });
    }

We strongly recommend that you should do try-catch in continuation function since it usually behave differently in different version of Unity. I recall that, with earlier Unity versions, if you throw an exception in the continuation function of ContinueWith(), the app may have hard crash or the thread would crash silently. I did not observed this behavior in Unity 2020 though.

Hope this answered your concern.

And please, do try our quickstart. Let us know if you cannot see the non-fatal error even using the quickstart.

Shawn

google-oss-bot commented 3 years ago

Hey @jlubeck. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

jlubeck commented 3 years ago

The problem is that I installed a new version of unity and my build system is broken. So I can't test anything until I fix that :( Please don't close this, I'll get back here as soon as I can

DellaBitta commented 3 years ago

I'm not going to close the issue, but I'm going to change to needs-info for our issue tracking system.

simontgs commented 3 years ago

Note: we are experiencing a similar issue, i am unable to get off the green crashlytics screen in the dashboard, it is still awaiting for events We're on 2020.1.17, FIrebase 7.00+ and installed via the package manager. No luck with either Android or iOS right now

We're using xcode 12.2 for ios, we had no issues on 6.15.2 and 2019.4 I've triple checked the googleinfo plist file and all good there. Follow the documentation steps thoroughly

The one thing that was wrong for iOS was the target membership in xcode was incorrect, it was set to unityframework and not the unity-iphone project, we've worked around it by changing our postprocessor but the app would crash on boot saying it couldn't find the plist file.

Other than that, with the debug log, we're getting the same, just says

DEBUG: App initializer crashlytics not found, failed to enable.

The usual code to check and fix passes fine.. var dependencyStatus = await Firebase.FirebaseApp.CheckAndFixDependenciesAsync(); if (dependencyStatus == Firebase.DependencyStatus.Available)

thnx

google-oss-bot commented 3 years ago

Hey @jlubeck. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

chkuang-g commented 3 years ago

@simontgs I believe that postprocessor workaround is related to this https://github.com/firebase/quickstart-unity/issues/862#issuecomment-758893827

I just tried quickstart with 7.0.2 and I can see those events showing up a couple of minutes later. I did not use use_frameworks!, empty Unity-iPhone target and the post process though.

Could you describe a bit more about what your Xcode project looks like? Ex. Podfile, target membership you changed. Also, could you post the log from Xcode when you run quickstart? I actually did not see anything like DEBUG: App initializer crashlytics not found, failed to enable.

@jlubeck Any news?

Shawn

simontgs commented 3 years ago

Just to add more info - installing firebase directly rather than via Unity package manager - crashlytics works as expected. I am still trying to get to the bottom of why it wont register when using it via the scoped registry.

jlubeck commented 3 years ago

@jlubeck

I think I know what is going on here. The key is that you throw the exception within the continuation function of ContinueWithOnMainThread().

If any exception is thrown in the continuation function, the exception will be stored in the task it returns.

Try this:

    public virtual void Start() {
      FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
        dependencyStatus = task.Result;
        if (dependencyStatus == DependencyStatus.Available) {
          InitializeFirebase();
        } else {
          Debug.LogError(
            "Could not resolve all Firebase dependencies: " + dependencyStatus);
        }
      }).ContinueWithOnMainThread(task => {
          if (task.IsFaulted) {
              Debug.LogException(task.Exception);
          }
      }).ContinueWith(task => {
        Debug.LogWarning("Throw an exception from a non-main thread.");
        throw new System.Exception("An exception from a non-main thread");
      }).ContinueWithOnMainThread(task => {
          if (task.IsFaulted) {
              Debug.LogException(task.Exception);
          }
      });
    }

We strongly recommend that you should do try-catch in continuation function since it usually behave differently in different version of Unity. I recall that, with earlier Unity versions, if you throw an exception in the continuation function of ContinueWith(), the app may have hard crash or the thread would crash silently. I did not observed this behavior in Unity 2020 though.

Hope this answered your concern.

And please, do try our quickstart. Let us know if you cannot see the non-fatal error even using the quickstart.

Shawn

I just finally had time to try this, and I see the exceptions in my console but I still can't get past the green screen on Firebase console :(

chkuang-g commented 3 years ago

@simontgs Thank you for verifying the unitypackage version. This seems to be a different issue. Could you open a different issue and add a bit more detail about your situation?

@jlubeck If you use exactly the code I wrote, there won't be any Crashlytics event at all, since the code caught and handle everything already.

If you like to see Crashlytics event, try to replace Debug.LogException() with Firebase.Crashlytics.Crashlytics.LogException().

As said, since anything thrown within a continuation function, ex. ContinueWith() and ContinueWithOnMainThread(), will be captured in the returned Task, Crashlyitcs would never able to detect it unless you explicitly report it. Crashlytics can only capture unhandled exceptions or app crashes.

Let us know. Shawn

google-oss-bot commented 3 years ago

Hey @jlubeck. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 3 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@jlubeck if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.