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

Analytics is not started on 7.5.0 and later versions #7595

Closed
fthdgn opened this issue Feb 23, 2021 · 11 comments
Closed

Analytics is not started on 7.5.0 and later versions #7595

fthdgn opened this issue Feb 23, 2021 · 11 comments

Comments

@fthdgn
Copy link

fthdgn commented Feb 23, 2021

[REQUIRED] Step 1: Describe your environment

  • Xcode version:12.4 (12D4e)
  • Firebase SDK version: 7.5.0, 7.6.0, 7.7.0
  • Installation method: CocoaPods
  • Firebase Component: Analytics

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

The latest version of our app is not visible on Firebase console. A/B testing is not working, and Latest Release does not detect the release even though, according to Apple Analytics, the sessions of newest release surpassed the sessions of old version.
When we analyzed console logs of previous version and the latest version, we noticed that Firebase Analytics are does not start on the latest version. Analytics v.7.6.0 started line is not printed. We tested 7.5.0 and 7.7.0, the line is not printed on them too. The line is printed on 7.4.0. The line also printed on Debug build. The problem occurs on Release build since 7.5.0.
We are suspecting the reason of Firebase console problems is related the lack of Analytics v.7.7.0 started log.

We cannot find anything on changelog and documentations.

Relevant Code:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        ...
        FirebaseApp.configure()
        ...
        return true
    }
@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@fthdgn fthdgn changed the title Analytics is not started since 7.5.0 Analytics is not started on 7.5.0 and later versions Feb 23, 2021
@paulb777
Copy link
Member

I've confirmed that I see Analytics v.7.7.0 started with the latest version installed via CocoaPods.

I suspect something is corrupt in your Xcode workspace. Perhaps pod deintegrate and pod update would resolve?

@paulb777
Copy link
Member

Or maybe an issue like #7521?

@morganchen12
Copy link
Contributor

Also, check to make sure you don't have duplicate Firebase class definitions in your app's runtime.

@fthdgn
Copy link
Author

fthdgn commented Feb 24, 2021

pod deintegrate and pod update didn't solve the problem.

But adding -ObjC option to Other Linker Flags solved the problem, Analytics v.7.7.0 started is printed on Release build.
CocoaPods adds -ObjC itself on 7.4.0, but not on 7.7.0

SPM documentation mentions this, but it was not required for CocoaPods.
Is it required now?

@paulb777
Copy link
Member

Interesting. It's likely a side-effect of a CocoaPods bug that was fixed in CocoaPods 1.10.1 that we added a workaround for in Firebase 7.5.0.

I suspect your use case may be something that we didn't test. Are you calling using Analytics APIs in the app? Or are you completely relying on Analytics being implicitly linked?

Either way, I suspect updating to CocoaPods 1.10.1 would be an alternative to needing to manually add the -ObjC option.

cc: @htcgh

@fthdgn
Copy link
Author

fthdgn commented Feb 24, 2021

I created a project to reproduce the problem.
7.7.0 does not add -ObjC and does not print log.
7.4.0 adds -ObjC and prints log.
Pod version is 1.10.1

There is no API call. Just FirebaseApp.configure() on application(_:didFinishLaunchingWithOptions:)

https://github.com/fthdgn/firebase-ios-sdk-issue-7595

@firebase firebase deleted a comment Feb 24, 2021
@paulb777
Copy link
Member

@fthdgn Thanks for the reproducible example. 👍 I've reproduced and will investigate.

@paulb777
Copy link
Member

paulb777 commented Feb 24, 2021

I opened CocoaPods issue CocoaPods/CocoaPods#10459

@paulb777
Copy link
Member

Proposed CocoaPods fix at CocoaPods/CocoaPods#10460

@paulb777
Copy link
Member

I'm going to close this here - since the fix will likely be part of CocoaPods 1.10.2. Track at CocoaPods/CocoaPods#10460

In the meantime, adding the -ObjC option to the Other Linker Flags Build Setting is the right workaround.

Thanks to @fthdgn for raising the issue and the repro case.

@firebase firebase locked and limited conversation to collaborators Mar 28, 2021
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

4 participants