Flutter升级后出现很多问题,无法再次运行App

max*_*lex 5 ios dart cocoapods flutter

我在终端中升级了 Flutter,无法再像以前一样在模拟器中启动我的应用程序。有很多错误,无论我做什么都没有改善。

\n

这是flutter run的输出

\n
1 warning generated.\n1 warning generated.\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/alts/al\nts_credentials.cc:21:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/alts/al\nts_credentials.h:27:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent\nials.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here\n[-Wnon-c-typedef-for-linkage]\ntypedef struct {\n              ^\n               grpc_credentials_mdelem_array\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent\nials.h:206:21: note: type is not C-compatible due to this default member initializer\n  grpc_mdelem* md = nullptr;\n                    ^~~~~~~\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credent\nials.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration\n} grpc_credentials_mdelem_array;\n  ^\n1 warning generated.\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/server/secure_server_credentials.c\nc:26:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con\ntext.h:28:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here\n[-Wnon-c-typedef-for-linkage]\ntypedef struct {\n              ^\n               grpc_credentials_mdelem_array\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:206:21: note: type is not C-compatible due to this default member initializer\n  grpc_mdelem* md = nullptr;\n                    ^~~~~~~\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration\n} grpc_credentials_mdelem_array;\n  ^\n1 warning generated.\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/client/secure_credentials.cc:19:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/client/secure_credentials.h:29:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here\n[-Wnon-c-typedef-for-linkage]\ntypedef struct {\n              ^\n               grpc_credentials_mdelem_array\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:206:21: note: type is not C-compatible due to this default member initializer\n  grpc_mdelem* md = nullptr;\n                    ^~~~~~~\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration\n} grpc_credentials_mdelem_array;\n  ^\n1 warning generated.\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_create_auth_context.\ncc:24:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con\ntext.h:28:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here\n[-Wnon-c-typedef-for-linkage]\ntypedef struct {\n              ^\n               grpc_credentials_mdelem_array\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:206:21: note: type is not C-compatible due to this default member initializer\n  grpc_mdelem* md = nullptr;\n                    ^~~~~~~\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration\n} grpc_credentials_mdelem_array;\n  ^\n1 warning generated.\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.cc:19:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/cpp/common/secure_auth_context.h:25:\nIn file included from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/context/security_con\ntext.h:28:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here\n[-Wnon-c-typedef-for-linkage]\ntypedef struct {\n              ^\n               grpc_credentials_mdelem_array\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:206:21: note: type is not C-compatible due to this default member initializer\n  grpc_mdelem* md = nullptr;\n                    ^~~~~~~\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/gRPC-C++/src/core/lib/security/credentials/credenti\nals.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration\n} grpc_credentials_mdelem_array;\n  ^\n1 warning generated.\n/Users/maximilianscheffel/Programming/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlu\ngin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]\n      settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"];\n               ^\nIn module 'FirebaseFirestore' imported from\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/Headers/Public/Firebase/Firebase.h:52:\n/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseF\nirestore/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here\n    __attribute__((deprecated));\n                   ^\n1 warning generated.\n../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method\nnamed 'inheritFromElement'.\n    return super.inheritFromElement(ancestor, aspect: aspect);\n                 ^^^^^^^^^^^^^^^^^^\n../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method\n'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.\n - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'\n ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').\nTry correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.\n        ? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n../../flutter/.pub-cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method\n'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.\n - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart'\n ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').\nTry correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.\n        : context.ancestorInheritedElementForWidgetOfExactType(type)?.widget\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCommand PhaseScriptExecution failed with a nonzero exit code\nnote: Using new build system\nnote: Building targets in parallel\nnote: Planning build\nnote: Analyzing workspace\nnote: Constructing build description\nnote: Build preparation complete\nwarning: Stale file\n'/Users/maximilianscheffel/Programming/flutter-firebase-lesson-5/brew_crew/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/geolo\ncator.framework' is located outside of the allowed root paths.\n\nnote: Removed stale file\n'/Users/maximilianscheffel/Library/Developer/Xcode/DerivedData/Runner-doisllnyaafdvqgfmxkajxjgbdts/Build/Products/Debug-iphonesimulato\nr/device_info/device_info.framework'\n
Run Code Online (Sandbox Code Playgroud)\n

颤动——版本

\n
Flutter 2.0.6 \xe2\x80\xa2 channel stable \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision 1d9032c7e1 (8 days ago) \xe2\x80\xa2 2021-04-29 17:37:58 -0700\nEngine \xe2\x80\xa2 revision 05e680e202\nTools \xe2\x80\xa2 Dart 2.12.3\n
Run Code Online (Sandbox Code Playgroud)\n

扑医生

\n
Doctor summary (to see all details, run flutter doctor -v):\n[\xe2\x9c\x93] Flutter (Channel stable, 2.0.6, on macOS 11.2.2 20D80 darwin-arm, locale de-DE)\n[\xe2\x9c\x93] Android toolchain - develop for Android devices (Android SDK version 28.0.3)\n[\xe2\x9c\x93] Xcode - develop for iOS and macOS\n[\xe2\x9c\x93] Chrome - develop for the web\n[\xe2\x9c\x93] Android Studio (version 3.6)\n[\xe2\x9c\x93] VS Code (version 1.56.0)\n[\xe2\x9c\x93] Connected device (2 available)\n\n\xe2\x80\xa2 No issues found!\n
Run Code Online (Sandbox Code Playgroud)\n

gen*_*xhd 0

首先运行flutter clean然后flutter pub get

如果错误未修复,请在 ios 文件夹中尝试:pod deintegrate然后pod install

否则,您可以创建一个新的 flutter 项目,并将项目中的 ios 文件夹替换为新项目的 ios 文件夹(注意:这会删除所有 ios 配置)。