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

[firebase_crashlytics] Migrate to new Crashlytics SDK #2288

Closed
wants to merge 29 commits into from

Conversation

axel-op
Copy link
Contributor

@axel-op axel-op commented Apr 2, 2020

Description

This PR updates the Crashlytics implementation to use the new SDK, which doesn't use the Fabric SDK anymore: https://firebase.google.com/docs/crashlytics/get-started-new-sdk.

Related Issues

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@MaikuB
Copy link
Contributor

MaikuB commented Apr 4, 2020

@axel-op I believe the title of the PR needs amending to start with [firebase_crashlytics] instead of [crashlytics] as it's the name of the plugin that should be used

@axel-op axel-op changed the title [crashlytics] Migrate to new Crashlytics SDK [firebase_crashlytics] Migrate to new Crashlytics SDK Apr 4, 2020
@axel-op
Copy link
Contributor Author

axel-op commented Apr 4, 2020

@MaikuB Thanks, it's done. What do you think of the PR?

@MaikuB
Copy link
Contributor

MaikuB commented Apr 4, 2020

@axel-op I'm not familiar with the APIs to comment. Came across your PR as another member in the community mentioned it :)

@axel-op axel-op force-pushed the crashlytics-new-sdk branch from 14966df to b22a659 Compare April 6, 2020 17:26
@axel-op axel-op force-pushed the crashlytics-new-sdk branch from 5de1034 to 748633d Compare April 8, 2020 01:36
@axel-op
Copy link
Contributor Author

axel-op commented Apr 8, 2020

I'll definitely need help for the iOs part.

@axel-op axel-op marked this pull request as draft April 8, 2020 22:05
@workerbee22
Copy link

What do we need to do to get this moving ... it's already very urgent.

@axel-op axel-op force-pushed the crashlytics-new-sdk branch 2 times, most recently from 2f337ad to d49998a Compare April 14, 2020 11:49
@axel-op
Copy link
Contributor Author

axel-op commented Apr 14, 2020

I have to update the README file

@axel-op axel-op force-pushed the crashlytics-new-sdk branch 2 times, most recently from 8ec938a to 5f88c57 Compare April 15, 2020 21:42
@workerbee22
Copy link

Wow ... @axel-op great progress 🎉🎉🎉

Copy link

@workerbee22 workerbee22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just some beta version updates.

packages/firebase_crashlytics/android/build.gradle Outdated Show resolved Hide resolved
packages/firebase_crashlytics/example/android/build.gradle Outdated Show resolved Hide resolved
@axel-op axel-op force-pushed the crashlytics-new-sdk branch from 5f88c57 to 08e56dd Compare April 19, 2020 15:14
@axel-op
Copy link
Contributor Author

axel-op commented Apr 19, 2020

Looks like they have moved to beta4 as per the official doco here

Thanks @workerbee22 for pointing that out :)

@axel-op
Copy link
Contributor Author

axel-op commented Apr 19, 2020

@workerbee22 and @creativecreatorormaybenot is everything OK for you?

@creativecreatorormaybenot
Copy link
Contributor

It seems as though my feedback has been addressed 👍🏼
Need some testing now to confirm that everything works as expected and a maintainer to take a look at this.

@axel-op
Copy link
Contributor Author

axel-op commented Apr 19, 2020

Well, I was just asking for your opinion, since I knew you would answer much faster ;)

@axel-op axel-op marked this pull request as ready for review April 20, 2020 17:34
Copy link

@workerbee22 workerbee22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@axel-op
Copy link
Contributor Author

axel-op commented Jun 1, 2020

@axel-op I'm skeptical about that as all that should already be handled and a lot of plugins that wrap around native SDKs work in a similar way without issues. I would think there's something else going on there that I wouldn't read too much into it unless a complete sample app can be provided to demonstrate it's needed. For what it's worth I work on an app that hasn't needed those steps and would expect it to be a more widespread issue if it was needed

Noted 👍

@MaikuB
Copy link
Contributor

MaikuB commented Jun 1, 2020

@MaikuB Also while testing I had to update my AppDelegate file like so. But I'm really not an expert in iOS development, so I'd really like to have a confirmation from an iOS developer.

If that's the case then it worth debugging the plugin further as it could mean that this isn't being called.

One alternative is to have the plugin register to receive AppDelegate calls and call configure like you currently do in the example app's AppDelegate.swift file. This would (1) remove the need to have developers do it themselves and (2) more closely mirror the setup required by a native iOS app. An example of how to have the plugin register to receive these calls can be found here. Not sure if there was a reason why it wasn't originally done this way though

@axel-op
Copy link
Contributor Author

axel-op commented Jun 1, 2020

@MaikuB Thanks! I'm not sure I should make these changes right now, as I believe the current rework by the people from Invertase will probably bring some important changes to the native part of all Firebase plugins, as this comment suggests.

@Ehesp
Copy link
Member

Ehesp commented Jun 1, 2020

With the upcoming changes, firebase_core will be required for other plugins to work. Part of the setup steps will be to ensure that the user adds these lines into your AppDelegate file.

We should have a PR up soon which overhauls Core, along with other changes (CI, tests etc) so it'd make more sense to sync this work up with that.

@MaikuB
Copy link
Contributor

MaikuB commented Jun 1, 2020

@Ehesp has the team looked at minimising the amount of code users need to put into their AppDelegate file as well? Flutter already provides mechanisms for plugins to receive AppDelegate calls. It looks like there's potential opportunity to do that in this PR as well

@Ehesp
Copy link
Member

Ehesp commented Jun 1, 2020

Yep that was a terrible example, we're doing that already - will link to the PR when it's up.

@thomas-stockx
Copy link
Contributor

This is slowly getting urgent as the Firebase team is sending out automated emails in regards to the Fabric Crashlytics SDK now being officially deprecated and will stop working on November 15, 2020.

implementation 'com.google.firebase:firebase-analytics:17.4.0'

// Add the Firebase SDK for Crashlytics.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Copy link
Contributor

@jpelgrim jpelgrim Jun 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency is already in the firebase_crashlytics package ./android/build.gradle file, right? We don't need to add it to our Flutter app build.gradle file IMO.

Update: Works fine without it in my case. I don't think the whole fourth step is needed. It's even a bit confusing and misleading to add the firebase-analytics dependency too here since it's not necessary for Firebase Crashlytics to work.

Copy link
Contributor

@MaikuB MaikuB Jun 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if it's already a dependency used by the plugin then developers shouldn't need to add it to their app's build.gradle file

cc @axel-op

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for the firebase_analytics ! I don't like the way the official documentation like this: https://firebase.google.com/docs/flutter/setup?platform=ios

Encourages other packages. It just leads to possible reader confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be updated when the package will depend on the new versions of firebase_core.

@gaetschwartz
Copy link

Do we have any updates on the status of this PR @axel-op ? I can help if needed but I'm pretty sure this PR is becoming quite urgent and it would be great to be able to push it asap ;)

@tillchen
Copy link
Contributor

tillchen commented Jul 2, 2020

Any updates? The discrepancy of documentations is very confusing now.

@axel-op
Copy link
Contributor Author

axel-op commented Jul 3, 2020

Do we have any updates on the status of this PR @axel-op ? I can help if needed but I'm pretty sure this PR is becoming quite urgent and it would be great to be able to push it asap ;)

I'm gonna work on it this weekend.

@axel-op axel-op force-pushed the crashlytics-new-sdk branch from f9100e2 to 66d2d14 Compare July 4, 2020 22:21
@axel-op
Copy link
Contributor Author

axel-op commented Jul 5, 2020

I think that we should now wait for the new releases of firebase_core that should be published next week.

@ened
Copy link
Contributor

ened commented Jul 7, 2020

@axel-op @Ehesp What is a good way to support NDK crash reports using the new SDK? See this page for a example on the native integration: https://firebase.google.com/docs/crashlytics/ndk-reports

It seems that integration of NDK crash reports requires a dependency change and some additional gradle configuration. Perhaps it is enough to mention it in the README?

@donguseo
Copy link

donguseo commented Jul 15, 2020

I think that we should now wait for the new releases of firebase_core that should be published next week.

firebase_core-v0.5.0-dev.1 is released! When will this pr be merged?

@Salakar
Copy link
Member

Salakar commented Jul 23, 2020

Hey everyone, good news; Crashlytics has been bumped to the top of the priority list on the roadmap #2582 - so we'll be looking at this next.

What would be helpful is if anyone that has been using this PR in production could respond here if there's still any outstanding issues they've discovered while using the code in this PR, thanks!


@axel-op if you're willing, do you have any form of messaging so we can chat quicker and help get this PR merged quicker? I'm Salakar#1337 on Discord, or @mikediarmid on Twitter if any of these work for you.

@Ehesp
Copy link
Member

Ehesp commented Jul 24, 2020

Hey all 👋 I've started the process of breaking out the work done by @axel-op into a federated plugin setup, along with some QOL updates to get it ready for review and release.

The PR is in-progress here https://github.com/invertase/flutterfire/pull/41

Thanks again for this contribution @axel-op 🥳

@axel-op
Copy link
Contributor Author

axel-op commented Jul 24, 2020

@Ehesp Thanks ☺️

@gaetschwartz
Copy link

Any updates on this PR ? ☺

@Ehesp
Copy link
Member

Ehesp commented Aug 3, 2020

Nope, currently going through updates and review still.

@gaetschwartz
Copy link

Is there progress on this PR ? And is there any way for me to help ? Would gladly help is you need some ;)

@yringler
Copy link

@blaxou , the PR is under active development, but at a new location https://github.com/invertase/flutterfire/pull/41. Latest activity was 4 days ago.

@Salakar Salakar mentioned this pull request Sep 1, 2020
13 tasks
@Salakar
Copy link
Member

Salakar commented Sep 1, 2020

Closing in favour of #3420

@Salakar Salakar closed this Sep 1, 2020
@firebase firebase locked and limited conversation to collaborators Oct 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet