firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.73k stars 3.98k forks source link

🐛 [firebase_dynamic_links] importing firebase_dynamic_links.dart causes crash #8192

Closed xuala69 closed 2 years ago

xuala69 commented 2 years ago

Bug report

When importing firebase_dynamic_link package, the app crashes with the error

Error: Method not found: 'Error.throwWithStackTrace'

 Error: Method not found: 'Error.throwWithStackTrace'.
../…/utils/exception.dart:16
  Error.throwWithStackTrace(
        ^^^^^^^^^^^^^^^^^^^

Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
../…/utils/exception.dart:11
Never convertPlatformException(Object exception, StackTrace stackTrace)

Steps to reproduce

Steps to reproduce the behavior:

  1. Setup firebase dynamic link into project as per documentation
  2. import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
  3. save

Expected behavior

Just importing to NOT give any error/

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19044.1526], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1)
[√] VS Code (version 1.64.2)
[√] Connected device (3 available)
Error log output
: Error: Method not found: 'Error.throwWithStackTrace'.
../…/utils/exception.dart:13
    Error.throwWithStackTrace(exception, stackTrace);
          ^^^^^^^^^^^^^^^^^^^
: Error: Method not found: 'Error.throwWithStackTrace'.
../…/utils/exception.dart:16
  Error.throwWithStackTrace(
        ^^^^^^^^^^^^^^^^^^^
: Error: A non-null value must be returned since the return type 'Never' doesn't allow null.
../…/utils/exception.dart:11
Never convertPlatformException(Object exception, StackTrace stackTrace) {

Flutter dependencies

Dart SDK 2.14.0
Flutter SDK 2.5.0 durkhawpui 1.0.0+1

dependencies:

dev dependencies:

transitive dependencies:

Juansho99 commented 2 years ago

how are you? what worked for me was downgrade my firebase packages in my pubspec, I hope it helps you.

darshankawar commented 2 years ago

@xuala69 The errors you are seeing could be due to lesser version of framework and firebase plugins you are using. I recommend you to upgrade stable to latest and also upgrade all firebase plugins to latest to avoid these compile errors which could be due to the conflict between the classes and firebase due to lesser versions.

Closing as this is not an issue but you need to upgrade framework and plugin versions.