16
 /Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:14:11: Error: Member not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace(exception, stackTrace); ^^^^^^^^^^^^^^^^^^^ /Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:17:9: Error: Member not found: 'Error.throwWithStackTrace'. Error.throwWithStackTrace( ^^^^^^^^^^^^^^^^^^^ /D:/Flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_platform_interface-6.2.0/lib/src/method_channel/utils/exception.dart:12:7: Error: A non-null value must be returned since the return type 'Never' doesn't allow null. Never convertPlatformException(Object exception, StackTrace stackTrace) { ^ FAILURE: Build failed with an exception. 

My pubsec.yaml has only:

  • cloud_firestore:
  • firebase_core:
  • uuid:
  • firebase_auth: ^3.3.8
  • provider: ^6.0.2

I got this error after importing firebase packages.

Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel master, 2.6.0-12.0.pre.657, on Microsoft Windows [Version 10.0.19044.1526], locale en-IN) [√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] Android Studio (version 2021.1) [√] Connected device (3 available) • No issues found! 
2
  • add specific version code to firebase_core and cloud_firestore , like this firebase_core: 1.13.1 .consider using all latest firebase package Commented Feb 26, 2022 at 6:45
  • 2
    firebase now has dependencies using Dart 2.16. Similar issue & solutions here Commented Feb 26, 2022 at 20:32

4 Answers 4

6

I tried using latest version but It didn't worked. Lower version firebase_auth: 2.0.0 worked for me.

Sign up to request clarification or add additional context in comments.

Comments

6

For me. upgrading flutter resolved the issue. flutter upgrade

1 Comment

this and I had to add this target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end
4

firebase now has dependencies using Dart 2.16. Similar issue & solutions here

Comments

0

I had the same issue. So I updated my flutter version(2.2.2) to a newer version(2.10.4) and it resolved the issue.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.