2

When I tried to upgrade my Flutter app (running on Flutter 3.3) to Flutter 3.10, it keeps on giving an error. I upgraded all my dependency versions except for a few because they had some conflicts.

I'm running this code on my Apple Silicon M1 computer.

First, I followed this answer to fix the first error I faced:

File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

After this was done, that particular error disappeared, but the following error couldn't be solved.

../../../.pub-cache/hosted/pub.dev/_discoveryapis_commons-1.0.3/lib/src/resumable_media_uploader.dart:78:44: 
Error: The method 'NullThrownError' isn't defined for the class 'ResumableMediaUploader'.

I tried many solutions including the obvious ones such as:

sudo gem uninstall cocoapods

brew install cocoapods

arch -x86_64 pod install

flutter clean
rm -Rf ios/Pods
rm ios/Podfile.lock
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec

But, none of these helped. I found a forum post saying that I should switch to XCode 14.3 Beta, but it still didn't solve the issue.

I cannot even find which dependency gives this error. So, how can I fix this?

[EDIT] I already fixed it and please see the answer.

Praneeth Peiris
  • 2,008
  • 20
  • 40

1 Answers1

0

The issue was with the Flutter Fire UI package, which has been deprecated. For anyone using that package, we have to move to separate packages for the same tasks.

firebase_ui_auth
firebase_ui_firestore
firebase_ui_database

Adding these dependencies instead of having flutterfire_ui fixed my issue.

Here is a dump of my dependencies including their current versions in case someone wants to refer.

name: adopt_a_book
description: Adopt a Book
publish_to: 'none'
version: 2.0.2+19

environment:
  sdk: '>=3.0.0 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  # Backend
  ## Core
  intl: ^0.18.0
  shared_preferences: ^2.1.1
  is_first_run: ^1.0.0
  http: ^0.13.6
  ## Logging
  sentry_flutter: ^7.5.2
  ## firebase
  firebase_core: ^2.12.0
  firebase_auth: ^4.6.0
  firebase_storage: ^11.2.0
  cloud_firestore: ^4.7.0

  ## Notifications
  firebase_messaging: ^14.6.0
  flutter_local_notifications: ^14.0.0+2
  overlay_support: ^2.1.0
  ## bloc
  flutter_bloc: ^8.1.2
  equatable: ^2.0.5
  ## google
  google_sign_in: ^6.1.0
  googleapis: ^11.0.0
  flutter_google_places: ^0.3.0
  google_maps_flutter: ^2.2.6
  ## location
  geolocator: ^9.0.2
  geocoding: ^2.1.0
  google_geocoding: ^0.2.0
  geoflutterfire:
    git:
        url: https://github.com/gnomezgrave/GeoFlutterFire.git
        ref: 3x_null_safety # branch name
  ## misc
  open_library: ^0.1.5

  # UI related
  toggle_switch: ^2.1.0
  smooth_page_indicator: ^1.1.0
  ## icons
  cupertino_icons: ^1.0.2
  font_awesome_flutter: ^10.4.0
  material_design_icons_flutter: ^6.0.7096
  flutter_native_splash: ^2.2.19
  
  # FlutterFire
  firebase_ui_auth: ^1.4.0
  firebase_ui_firestore: ^1.5.0
  firebase_ui_database: ^1.3.0
  
  # UI elements
  image_stack: ^2.1.0
  flutter_lorem: ^2.0.0
  readmore: ^2.1.0
  flutter_rating_bar: ^4.0.0
  lottie: ^2.3.2
  image_picker: ^0.8.7+5
  image_cropper: ^4.0.1
  flutter_barcode_scanner: ^2.0.0
  currency_picker: ^2.0.16

  fluttertoast: ^8.2.1
  flutter_html: ^3.0.0-beta.1

  # Feedback
  shake: ^2.2.0
  flutter_email_sender: ^5.2.0
  feedback: ^2.6.0
  path_provider: ^2.0.15

dev_dependencies:
  # flutter_launcher_icons: ^0.10.0
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.1

flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icons/app_icon_background.png"

flutter:

  uses-material-design: true

  assets:
  - assets/gifs/
  - assets/images/
  - assets/books/
  - assets/banners/
  - assets/icons/
  - assets/user/
  - assets/lottie/
  - assets/logo/
  - assets/onboarding/
  - assets/time/
  - assets/copyrights/
  - assets/theme/

  fonts:
    - family: Montserrat
      fonts:
        - asset: assets/fonts/Montserrat-VariableFont_wght.ttf
        - asset: assets/fonts/Montserrat-Italic-VariableFont_wght.ttf
          style: italic
    - family: BadScript
      fonts:
        - asset: assets/fonts/BadScript-Regular.ttf
    - family: DMSerifText
      fonts:
        - asset: assets/fonts/DMSerifText-Regular.ttf
        - asset: assets/fonts/DMSerifText-Italic.ttf
          style: italic
    - family: Baskervville
      fonts:
        - asset: assets/fonts/Baskervville-Regular.ttf
        - asset: assets/fonts/Baskervville-Italic.ttf
          style: italic
    - family: OpenSans
      fonts:
        - asset: assets/fonts/OpenSans-VariableFont_wdth.ttf
        - asset: assets/fonts/OpenSans-Italic-VariableFont_wdth.ttf
          style: italic

Please note geoflutterfire is not updated with the latest Google dependencies, so I forked it and upgrade myself.

Praneeth Peiris
  • 2,008
  • 20
  • 40