我在终端中升级了Flutter,不能再像以前一样在模拟器中启动我的应用程序。有很多错误,无论我做什么,它都不会变好。
这是颤振运行的输出
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 --版本
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颤振医生
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!发布于 2021-05-08 05:53:15
首先运行flutter clean,然后运行flutter pub get
如果错误没有修复,请尝试进入ios文件夹:pod deintegrate,然后是pod install
否则,您可以创建一个新的flutter项目,并将项目中的ios文件夹替换为新项目的ios文件夹(注意:这将删除所有ios配置)。
发布于 2021-07-26 10:28:17
我也有同样的问题。在我的例子中,我的pubspec.yaml中有一个包的旧版本,它不支持空安全。升级后,一切运行正常。因此,您可以检查您的应用程序依赖项。
此外,我建议尝试在XCode中建立应用程序,如果你得到的错误是不清楚的。在我看来,XCode提供了更好的错误输出。在我的例子中,XCode错误直接告诉我哪个包不支持空安全性。
发布于 2021-09-12 14:33:47
我也有同样的问题。升级了flutter来找出这个错误,我无论如何也不能把它找出来。我尝试编辑pod文件,将iOS目标部署设置为7,8,9,12等,详细的颤动构建,降级颤动SDK等。
最后,对我起作用的是运行另一个颤动应用程序,它在iPhone模拟器(12Pro Max)中编译并运行。然后,我重新运行了之前给出这些错误的项目。它编译得很好。
https://stackoverflow.com/questions/67441510
复制相似问题