I upgraded Flutter in the terminal and can no longer launch my app in the simulator as before. There are a lot of mistakes and no matter what I do it doesn't get better.

This is the output of flutter run

1 warning generated.
1 warning generated.
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/alts/al
ts_credentials.cc:21:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/alts/al
ts_credentials.h:27:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent
ials.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here
[-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               grpc_credentials_mdelem_array
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent
ials.h:206:21: note: type is not C-compatible due to this default member initializer
  grpc_mdelem* md = nullptr;
                    ^~~~~~~
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent
ials.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
  ^
1 warning generated.
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/server/secure_server_credentials.c
c:26:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con
text.h:28:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here
[-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               grpc_credentials_mdelem_array
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:206:21: note: type is not C-compatible due to this default member initializer
  grpc_mdelem* md = nullptr;
                    ^~~~~~~
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
  ^
1 warning generated.
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/client/secure_credentials.cc:19:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/client/secure_credentials.h:29:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here
[-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               grpc_credentials_mdelem_array
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:206:21: note: type is not C-compatible due to this default member initializer
  grpc_mdelem* md = nullptr;
                    ^~~~~~~
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
  ^
1 warning generated.
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_create_auth_context.
cc:24:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con
text.h:28:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here
[-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               grpc_credentials_mdelem_array
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:206:21: note: type is not C-compatible due to this default member initializer
  grpc_mdelem* md = nullptr;
                    ^~~~~~~
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
  ^
1 warning generated.
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.cc:19:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:
In file included from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con
text.h:28:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here
[-Wnon-c-typedef-for-linkage]
typedef struct {
              ^
               grpc_credentials_mdelem_array
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:206:21: note: type is not C-compatible due to this default member initializer
  grpc_mdelem* md = nullptr;
                    ^~~~~~~
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti
als.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
  ^
1 warning generated.
/Users/maximilianscheffel/Programming/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlu
gin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]
      settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"];
               ^
In module 'FirebaseFirestore' imported from
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/Headers/Public/Firebase/Firebase.h:52:
/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseF
irestore/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here
    __attribute__((deprecated));
                   ^
1 warning generated.
../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method
named 'inheritFromElement'.
    return super.inheritFromElement(ancestor, aspect: aspect);
                 ^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method
'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
 ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        ? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method
'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'
 ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
        : context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
warning: Stale file
'/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/geolo
cator.framework' is located outside of the allowed root paths.

note: Removed stale file
'/Users/maximilianscheffel/Library/Developer/Xcode/DerivedData/Runner-doisllnyaafdvqgfmxkajxjgbdts/Build/Products/Debug-iphonesimulato
r/device_info/device_info.framework'

flutter --version

Flutter 2.0.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1d9032c7e1 (8 days ago) • 2021-04-29 17:37:58 -0700
Engine • revision 05e680e202
Tools • Dart 2.12.3

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on macOS 11.2.2 20D80 darwin-arm, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.56.0)
[✓] Connected device (2 available)

• No issues found!


Solution 1: generalxhd

First of all run flutter clean and then flutter pub get

If the error isn't fixed, try in the ios folder: pod deintegrate then pod install

Else you can create a new flutter project and replace your ios folder in your project, with the ios folder of your new project (note: that deletes all your ios configurations).


Solution 2: tobzilla90

I had the same Issue. In my case I had an old version of a package in my pubspec.yaml which was not supporting null safety. After upgrading everything worked fine. So you might check your app dependencies.

Also I would recommend to try to build the app in XCode if you get errors which are not clear. XCode for my opinion provides better error outputs. In my case the XCode error directly told me which package was not supporting null safety.


Solution 3: Aadn

I had the exact same issue. Upgraded flutter to find this error, and I could not for the life of me sort it out. I tried editing pod file, setting iOS target deployment to 7,8,9,12 etc, verbose flutter builds, Downgrading flutter SDK etc.

Finally what worked for me, was to run another flutter app, that compiled, and ran in the iPhone simulator (12Pro Max). Then I re-ran my project that was previously giving these errors. and it compiled fine.


Solution 4: WaheedHussain

I had the same error the solution which worked for me is

  1. Opened the project in Xcode and ran it there in the logs I could see more proper logs which packages version needs to be updated
  2. from the above step update all the plugins to the latest versions and it fixed the issue for me


Solution 5: Mayvas

You need to change the configurations of the project on Xcode as it is in the image below

enter image description here