Skip to content

[firebase_analytics] Tutorial "Add Firebase to your Flutter app" did not work #1384

@suztomo

Description

@suztomo

Describe the bug

https://firebase.google.com/docs/flutter/setup does not work for Firebase Analytics.

Steps to Reproduce

  1. Go through Flutter Firebase tutorial with Firebase Analytics: https://firebase.google.com/docs/flutter/setup. Using https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_analytics/example
    Screen Shot 2019-11-07 at 9 17 39
    Ensure GoogleService-Info.plist is in XCode:
    Screen Shot 2019-11-12 at 9 23 38
    I added "-FIRDebugEnabled" to scheme.
  2. Wait 24 hours
  3. Firebase Analytics does not show anything:
    Screen Shot 2019-11-07 at 9 12 16
    Screen Shot 2019-11-07 at 9 20 38

Expected behavior
Firebase Analytics show some data from the app.

Target Platform:
iOS
Target OS version/browser:
iOS 13.2 (Simulator)
Devices:
iOS Simulator iPhone 11 Pro Max
and
iPhone SE (not simulator)

Logs

Here is logs from the application startup in XCode when I ran it for the simulator:

2019-11-07 08:49:44.125876-0500 Runner[88829:6937609]  - <AppMeasurement>[I-ACS036002] 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
2019-11-07 08:49:44.260443-0500 Runner[88829:6937320] Configuring the default Firebase app...
2019-11-07 08:49:44.308298-0500 Runner[88829:6937320] Configured the default Firebase app __FIRAPP_DEFAULT.
2019-11-07 08:49:44.363260-0500 Runner[88829:6937642] flutter: Observatory listening on http://127.0.0.1:62660/uT7_mQy6iVw=/
2019-11-07 08:49:44.941378-0500 Runner[88829:6937609] 6.11.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2019-11-07 08:49:44.941701-0500 Runner[88829:6937609] 6.11.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2019-11-07 08:49:44.942312-0500 Runner[88829:6937609] 6.11.0 - [Firebase/Core][I-COR000033] Data Collection flag is not set.
2019-11-07 08:49:44.942488-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    acct = "com.appspot.sztm.HelloFirebaseSztm";
    class = genp;
    gena = "com.google.iid";
    "m_Limit" = "m_LimitAll";
    "r_Attributes" = 1;
    "r_Data" = 1;
    svce = "com.google.iid.checkin";
}
2019-11-07 08:49:44.942640-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    atag = {length = 18, bytes = 0x636f6d2e676f6f676c652e6969642d7c4b7c};
    class = keys;
    "r_Ref" = 1;
    type = 42;
}
2019-11-07 08:49:44.942776-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    atag = {length = 18, bytes = 0x636f6d2e676f6f676c652e6969642d7c507c};
    class = keys;
    "r_Ref" = 1;
    type = 42;
}
2019-11-07 08:49:44.947071-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID009000] No keypair info is found with tag com.google.iid-|K|
2019-11-07 08:49:44.947249-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID009006] There's no legacy keypair so no need to do migration.
2019-11-07 08:49:44.947376-0500 Runner[88829:6937609] 6.11.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    acct = "com.appspot.sztm.HelloFirebaseSztm";
    class = genp;
    gena = "com.google.iid-tokens";
    "m_Limit" = "m_LimitAll";
    "r_Attributes" = 1;
    "r_Data" = 1;
    svce = "947567047323:*";
}
2019-11-07 08:49:44.947527-0500 Runner[88829:6937609] 6.11.0 - [Firebase/Analytics][I-ACS024000] Debug mode is on
2019-11-07 08:49:44.947649-0500 Runner[88829:6937609] 6.11.0 - [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2019-11-07 08:49:45.261748-0500 Runner[88829:6937611] 6.11.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-11-07 08:49:45.262162-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60103000 started
2019-11-07 08:49:45.264925-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-11-07 08:49:45.265908-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-11-07 08:49:45.277997-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS031003] setScreenName:screenClass: must be called after a view controller has appeared
2019-11-07 08:49:45.280275-0500 Runner[88829:6937644] 6.11.0 - [GULReachability][I-REA902004] Network status has changed. Code:2, status:Connected
2019-11-07 08:49:45.311344-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS031010] Tracking view controller. Class, ID: FlutterViewController, 4688821523934354282
2019-11-07 08:49:45.311614-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: FlutterViewController, 4688821523934354282
2019-11-07 08:49:45.632050-0500 Runner[88829:6937644] 6.11.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
2019-11-07 08:49:46.473780-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS029017] Configuration was not found in database. The configuration will be fetched from the network when necessary
2019-11-07 08:49:46.474840-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS023016] Analytics is ready to receive events
2019-11-07 08:49:46.619744-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2019-11-07 08:49:46.623121-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): -76.61791610717773
2019-11-07 08:49:46.623653-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): -76.61791610717773
2019-11-07 08:49:46.623898-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2019-11-07 08:49:46.624197-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2019-11-07 08:49:46.625797-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023012] Analytics enabled
2019-11-07 08:49:46.626540-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, screen_view (_vs), {
    ga_event_origin (_o) = auto;
    ga_screen_class (_sc) = FlutterViewController;
    ga_screen_id (_si) = 4688821523934354282;
}
2019-11-07 08:49:46.627417-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023073] Debug mode is enabled. Marking event as debug and real-time. Event name, parameters: screen_view (_vs), {
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = auto;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = FlutterViewController;
    ga_screen_id (_si) = 4688821523934354282;
}
2019-11-07 08:49:47.086213-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: screen_view (_vs), {
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = auto;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = FlutterViewController;
    ga_screen_id (_si) = 4688821523934354282;
}
2019-11-07 08:49:47.103606-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023027] Do not schedule an upload task. Task already exists. Will be executed in seconds: -77.08841514587402
2019-11-07 08:49:47.108694-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS002001] Measurement timer fired
2019-11-07 08:49:47.113948-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2019-11-07 08:49:47.114452-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023033] Starting data upload
2019-11-07 08:49:47.115125-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023037] No data to upload
2019-11-07 08:49:47.115603-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023126] Fetching configuration from the server
2019-11-07 08:49:47.241090-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS900001] Downloading data. Host: https://app-measurement.com/config/app/1:947567047323:ios:c8456dabdaf3d0d3944c3e?platform=ios&app_instance_id=160A9A2BD9C24151A452C298D95C4A3F&gmp_version=60103
2019-11-07 08:49:47.349510-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/config/app/1:947567047323:ios:c8456dabdaf3d0d3944c3e?platform=ios&app_instance_id=160A9A2BD9C24151A452C298D95C4A3F&gmp_version=60103
2019-11-07 08:49:47.577356-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS023127] Fetched configuration. Status code: 200
2019-11-07 08:49:47.594505-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS023133] Successful fetched configuration from the server. Got network response. Code, size: 200, 236
<ERROR> MeasurementConfig decoder failed: varint overflow
2019-11-07 08:49:47.622003-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023135] Configuration data is invalid.
2019-11-07 08:49:47.633837-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS034010] Transaction failed
2019-11-07 08:49:47.643274-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023033] Starting data upload
2019-11-07 08:49:47.645430-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023105] Event is not subject to real-time event count daily limit. Marking an event as real-time. Event name, parameters: user_engagement (_e), {
    engagement_time_msec (_et) = 1;
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = auto;
    ga_realtime (_r) = 1;
    ga_screen (_sn) = /;
    ga_screen_class (_sc) = Flutter;
    ga_screen_id (_si) = 1;
}
2019-11-07 08:49:47.646820-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023105] Event is not subject to real-time event count daily limit. Marking an event as real-time. Event name, parameters: screen_view (_vs), {
    ga_debug (_dbg) = 1;
    ga_event_origin (_o) = auto;
    ga_realtime (_r) = 1;
    ga_screen_class (_sc) = FlutterViewController;
    ga_screen_id (_si) = 1;
}
2019-11-07 08:49:47.647596-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: lifetime_user_engagement (_lte), 12
2019-11-07 08:49:47.648459-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: lifetime_user_engagement (_lte), 12
2019-11-07 08:49:47.649067-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: session_user_engagement (_se), 12
2019-11-07 08:49:47.649684-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: session_user_engagement (_se), 12
2019-11-07 08:49:47.649989-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS012018] Saving bundle. size (bytes): 421
2019-11-07 08:49:47.650241-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023116] Bundle added to the upload queue. BundleID, timestamp (ms): 13, 1573134585297
2019-11-07 08:49:47.861894-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023038] Uploading events. Elapsed time since last successful upload (s): 41228.05698013306
2019-11-07 08:49:47.871812-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS023039] Measurement data sent to network. Timestamp (ms), data: 1573134587851, <APMPBMeasurementBatch: 0x60000084e630>
2019-11-07 08:49:47.882457-0500 Runner[88829:6937616] 6.11.0 - [Firebase/Analytics][I-ACS900000] Uploading data. Host: https://app-measurement.com/a
2019-11-07 08:49:48.211802-0500 Runner[88829:6937611] 6.11.0 - [Firebase/Analytics][I-ACS901006] Received SSL challenge for host. Host: https://app-measurement.com/a
2019-11-07 08:49:48.265827-0500 Runner[88829:6937610] 6.11.0 - [Firebase/Analytics][I-ACS023044] Successful upload. Got network response. Code, size: 204, -1
2019-11-07 08:49:48.268232-0500 Runner[88829:6937610] 6.11.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): -1.970462083816528
2019-11-07 08:49:48.268810-0500 Runner[88829:6937610] 6.11.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): -1.970462083816528
2019-11-07 08:49:48.393171-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled
2019-11-07 08:49:48.398344-0500 Runner[88829:6937644] 6.11.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled

~/Documents/hello_firebase_sztm $ flutter analyze
Analyzing hello_firebase_sztm...                                        
No issues found! (ran in 4.2s)
suztomo@suztomonoMBP.verizon.net ~/Documents/hello_firebase_sztm
~/Documents/hello_firebase_sztm $ flutter doctor -v
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.6 18G87, locale en-JP)
    • Flutter version 1.9.1+hotfix.6 at /Users/suztomo/local/flutter
    • Framework revision 68587a0916 (8 weeks ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.


[✓] Xcode - develop for iOS and macOS (Xcode 11.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2, Build version 11B52
    • CocoaPods version 1.8.4

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[!] IntelliJ IDEA Community Edition (version 2019.1.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.6.0

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • 16B6A8C8-4CDC-4AB6-BBA7-88FAFC3562A3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-2 (simulator)

! Doctor found issues in 3 categories.

Other information

Cloud Firestore worked fine with my Flutter development environment. This means GoogleService-Info.plist has been added to XCode correctly. I'm feeling this is specific to Flutter Firebase Analytics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't workingtype: documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions