英文:
Firebase Analytics on Xcode got error FIRAnalytics and FIRConsent undeclared identifier
问题
我在flutter上开发一个应用程序,在尝试在xcode上构建我的应用程序时遇到了错误。我得到了这样的错误:
以下是我得到的大部分错误:
> 使用未声明的标识符'FIRAnalytics'
这是我使用的技术:
我不知道该如何处理这个错误,这是我第一次在flutter上使用firebase,当我为android构建时没有问题。
有人能告诉我我需要做什么来解决这个问题吗?
英文:
I was working an app on flutter and got error when I tried to build my app on xcode. I got error like this :
Here's the most error I get
> Use of undeclared identifier 'FIRAnalytics'
And here is the technology I used :
I don't know what should I do with this error, this is my first time using firebase on flutter and there is no problem when I build for android.
Can someone tell me what I need to do to solve this?
答案1
得分: 1
我遇到了相同的问题,在我的情况下,与我使用的Min Dart SDK版本有关。请检查您的版本,并确保您正在使用的所有firebase库与您已安装的Dart SDK版本匹配。
- 检查pubspec.yaml文件中的
environment.sdk
以检查SDK约束(我的是>=2.14.0 <3.0.0
)。 - 获取实际的依赖项列表:
dart pub deps
。 - 对于每个firebase依赖项,请访问https://pub.dev/。
- 按名称搜索依赖项。
- 打开“版本”选项卡,查看“Min Dart SDK”列。
- 检查库版本是否在所述步骤范围内。
这是我的pubspec.yaml
中的firebase依赖项:
firebase_core: 2.11.0
firebase_remote_config: ^3.0.15
firebase_analytics: ^10.1.6
为了避免出现最新版本(在我的情况下,这就是引发Analytics问题的原因),firebase_core
依赖项需要保持不变。
英文:
I stumbled in the same issue and, in my case, it was related to the Min Dart SDK version I was using. Please check yours and be sure that all the firebase libraries you are using match the Dart SDK version you have installed.
- Check pubspec.yaml
environment.sdk
check SDK contraints (mine were>=2.14.0 <3.0.0
) - Get the actual list of dependencies:
dart pub deps
- For each firebase dependency go to https://pub.dev/
- Search dependency by name
- Open the "Versions" tab and look at the column "Min Dart SDK"
- Check if the library version is within the range of the step
These are my firebase dependencies in pubspec.yaml
:
firebase_core: 2.11.0
firebase_remote_config: ^3.0.15
firebase_analytics: ^10.1.6
The firebase_core
dependency needs to stay fixed to avoid getting the latest (that was the one that cause the issue with Analytics, in my case)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论