Flutterfire: 🐛 [firebase_crashlytics] New 0.2.0-dev.5 version causes issues with flutter 1.19, update min flutter version for the plugin

Created on 9 Sep 2020  ·  7Comments  ·  Source: FirebaseExtended/flutterfire

When using the new firebase_crashlytics plugin in our pubspec.yaml file, the following error occurs when running flutter pub upgrade

Because every version of flutter_test from sdk depends on stack_trace 1.9.3 and firebase_crashlytics >=0.2.0-dev.1 depends on stack_trace ^1.9.5, flutter_test from sdk is incompatible with firebase_crashlytics >=0.2.0-dev.1.

Our pubspec contains:

dependencies:
  flutter:
    sdk: flutter

  firebase_core: ^0.5.0
  firebase_crashlytics: ^0.2.0-dev.5

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_driver:
    sdk: flutter

Flutter doctor:
[✓] Flutter (Channel beta, 1.19.0-4.1.pre, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.19.0-4.1.pre at /Users/danny.valente/Library/flutter/1.19.0-4.1.pre-beta
• Framework revision f994b76974 (3 months ago), 2020-06-09 15:53:13 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)

When using flutter 1.22, the problem goes away.
I'd recommend updating the min version of flutter for this plugin so developers know that it doesn't work well with versions less than 1.22. I didn't test 1.20 or 1.21.

crashlytics bug enhancement

Most helpful comment

@TahaTesser Thanks for the response. I reported this bug saying that it doesn't work with an older version of Flutter, yet the plugin states that it does. The age of the SDK should not be important here. If someone wants to update a particular plugin, but doesn't have the capacity to update the flutter SDK, the plugin needs to properly state what minimum version of flutter is needed. There is versioning in pubspec that handles exactly this sort of problem.

firebase_crashlytics' pubspec declares:

environment:
  sdk: ">=2.8.0 <3.0.0"
  flutter: ">=1.12.13+hotfix.5 <2.0.0"

That is wrong and untrue, and should be updated to whatever flutter version works with stack_trace 1.9.5, or firebase_crashlytics needs to go back to using stack_trace 1.9.3 if it wants to continue supporting older flutter versions.

Thanks!

All 7 comments

Can't reproduce this

  firebase_core: ^0.5.0
  firebase_crashlytics: ^0.2.0-dev.5


flutter doctor -v

[✓] Flutter (Channel beta, 1.21.0-9.2.pre, on Mac OS X 10.15.6 19G2021, locale en-GB)
    • Flutter version 1.21.0-9.2.pre at /Users/tahatesser/Code/flutter_beta
    • Framework revision 81a45ec2e5 (2 weeks ago), 2020-08-27 14:14:33 -0700
    • Engine revision 20a9531835
    • Dart version 2.10.0 (build 2.10.0-7.3.beta)


[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (3 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64  • Android 10 (API 29)
    • Web Server (web) • web-server       • web-javascript • Flutter Tools
    • Chrome (web)     • chrome           • web-javascript • Google Chrome 85.0.4183.102

! Doctor found issues in 1 category.

@TahaTesser the problem can be easily reproduced adding those to dev_dependencies block:

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_driver:
    sdk: flutter

  ...

I'm in Beta 1.18.0-11.1.pre channel

The error can't be reproduced in current stable 1.20.3

@matpag is right. Thanks for responding. The min flutter version needs to be updated, or the new firebase_crashlytics plugin should be using stack_trace 1.9.3 instead of 1.9.5.

Adding the dev dependencies cause the issue. I apologize for missing that. I'll update the original description.

Hi @dannyvalentesonos
Looks like you're running.3 months old beta. I can't reproduce it on the latest beta


dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3
  firebase_core: ^0.5.0
  firebase_crashlytics: ^0.2.0-dev.5

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_driver:
    sdk: flutter

```
Running "flutter pub get" in firebase_crashlytics_example... 1.5s


<details> 
<summary>flutter doctor -v</summary> 

```bash
[✓] Flutter (Channel beta, 1.21.0-9.2.pre, on Mac OS X 10.15.6 19G2021, locale en-GB)
    • Flutter version 1.21.0-9.2.pre at /Users/tahatesser/Code/flutter_beta
    • Framework revision 81a45ec2e5 (2 weeks ago), 2020-08-27 14:14:33 -0700
    • Engine revision 20a9531835
    • Dart version 2.10.0 (build 2.10.0-7.3.beta)


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/tahatesser/Code/sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /Users/tahatesser/Code/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

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

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (3 available)
    • iPhone 11 (mobile) • 73130414-6DF8-4E37-B9AF-F81FA0F9068B • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
    • Web Server (web)   • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome
      85.0.4183.102

• No issues found!

@TahaTesser Thanks for the response. I reported this bug saying that it doesn't work with an older version of Flutter, yet the plugin states that it does. The age of the SDK should not be important here. If someone wants to update a particular plugin, but doesn't have the capacity to update the flutter SDK, the plugin needs to properly state what minimum version of flutter is needed. There is versioning in pubspec that handles exactly this sort of problem.

firebase_crashlytics' pubspec declares:

environment:
  sdk: ">=2.8.0 <3.0.0"
  flutter: ">=1.12.13+hotfix.5 <2.0.0"

That is wrong and untrue, and should be updated to whatever flutter version works with stack_trace 1.9.5, or firebase_crashlytics needs to go back to using stack_trace 1.9.3 if it wants to continue supporting older flutter versions.

Thanks!

@dannyvalentesonos
Now it makes sense to me, Thanks for clarifying

Before the new version is released, you can only use mandatory override of the dependent version:

dependencies_overrides:
  stack_trace: ^1.9.3
Was this page helpful?
0 / 5 - 0 ratings