xcode - 找不到“FLTFirebasePlugin”颤振的协议声明
问题描述
我最近遇到了这个让我做噩梦好几天的错误,基本上当我尝试使用 FirebaseAuth 和 FirebaseCore 时,XCode 一直在向我抛出这个奇怪的错误,如图所示,这是 Flutter 构建日志:
Launching lib/main.dart on iPhone 12 Pro in debug mode...
Running pod install... 9,7s
Running Xcode build...
Xcode build done. 68,6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
1 warning generated.
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePluginRegistry.m:5:
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePluginRegistry.h:6:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePlugin.h:11:38: warning: extra tokens at end of #import directive [-Wextra-tokens]
#import <FirebaseCore/FirebaseCore.h>.
^
//
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePluginRegistry.m:5:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePluginRegistry.h:7:38: warning: extra tokens at end of #import directive [-Wextra-tokens]
#import <FirebaseCore/FirebaseCore.h>.
^
//
2 warnings generated.
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePlugin.m:5:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePlugin.h:11:38: warning: extra tokens at end of #import directive [-Wextra-tokens]
#import <FirebaseCore/FirebaseCore.h>.
^
//
1 warning generated.
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebaseCorePlugin.m:5:
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebaseCorePlugin.h:11:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePlugin.h:11:38: warning: extra tokens at end of #import directive [-Wextra-tokens]
#import <FirebaseCore/FirebaseCore.h>.
^
//
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebaseCorePlugin.m:6:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.4.0/ios/Classes/FLTFirebasePluginRegistry.h:7:38: warning: extra tokens at end of #import directive [-Wextra-tokens]
#import <FirebaseCore/FirebaseCore.h>.
^
//
2 warnings generated.
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/FLTPhoneNumberVerificationStreamHandler.m:6:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/Public/FLTFirebaseAuthPlugin.h:16:70: error: cannot find protocol declaration for 'FLTFirebasePlugin'
@interface FLTFirebaseAuthPlugin : FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin>
^
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/Public/FLTFirebaseAuthPlugin.h:16:36: error: cannot find interface declaration for 'FLTFirebasePlugin', superclass of 'FLTFirebaseAuthPlugin'
@interface FLTFirebaseAuthPlugin : FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
2 errors generated.
In file included from /Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/FLTIdTokenChannelStreamHandler.m:8:
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/Public/FLTFirebaseAuthPlugin.h:16:70: error: cannot find protocol declaration for 'FLTFirebasePlugin'
@interface FLTFirebaseAuthPlugin : FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin>
^
/Users/leonardo/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.0.1/ios/Classes/Public/FLTFirebaseAuthPlugin.h:16:36: error: cannot find interface declaration for 'FLTFirebasePlugin', superclass of 'FLTFirebaseAuthPlugin'
@interface FLTFirebaseAuthPlugin : FLTFirebasePlugin <FlutterPlugin, FLTFirebasePlugin>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'abseil' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'leveldb-library' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-Core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Flutter' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro.
这些是我在 .yaml 中导入的 Firebase 库
firebase_core: ^1.4.0
firebase_analytics: ^8.2.0
firebase_auth: ^3.0.1
cloud_firestore: ^2.4.0
firebase_storage: ^10.0.1
我的 Xcode 版本是 12.2
如果有人可以帮助我,我会非常感激,谢谢。
解决方案
推荐阅读
- java - 执行失败:java.io.IOException:无法在打开的 jdk 9 中运行程序“native2ascii”
- multithreading - 在同一个 JVM 中同时运行 2 个 SpringApplication?
- android - 按下返回时默认启动器未启动
- java - 如何从 FTPClient 获取文件并转换为文件?
- java - 无法解析 onBindViewHolder 中的符号“textView”
- node.js - 在 nodejs 中使用 msnodesqlv8 创建连接池
- flutter - 你可以在颤振布局中插入原生布局吗?
- html - 图像上的文本叠加
- android - 无法在 Android 设备上运行 Flutter 项目:ProcessException: gradlew异常退出
- javascript - Bootstrap 4 计数器 - 最长持续时间?