Flutter Firebase - 使用未声明的标识符“FIRAnalytics”

问题描述 投票:0回答:1

我正在我的 M3 Macbook 上开发一个 flutter 项目,并尝试实现 FirebaseAnalytics(顺便说一句,这不是第一次)。我完全按照指南进行操作,但出现错误;

我尝试清理

pub
xcode
simulator
的缓存。还将我的 flutter 版本从
3.16.9
升级到
3.19.0
。还尝试了
StackOverflow
Github
提出的每一个解决方案请求,但没有成功。这是我的 firebase 包依赖项;

pubspec.yaml

environment:
  sdk: '>=3.2.6 <4.0.0'

dependencies:
  firebase_analytics: ^10.8.6
  firebase_core: ^2.22.0
  firebase_messaging: ^14.7.15

医生:

[✓] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale
    tr-TR)
    • Flutter version 3.19.0 on channel stable at /Users/taha/Dev/core/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision bae5e49bc2 (6 days ago), 2024-02-13 17:46:18 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/taha/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.86.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.82.0

XCode 版本:15.2 (15C500b)

MacOS 版本:14.3.1 (23D60)

ios flutter firebase-analytics
1个回答
0
投票

在尝试了多种方法(更新操作系统、清理缓存、手动导入包等)来解决这个问题后,发现cocoapods有新版本了。我正在使用

1.15.1
。使用以下命令更新 cocoapods 后:

sudo gem install cocoapods

清除缓存

pod cache clean --all

删除了

ios

下的以下文件和文件夹
.symlinks
Pods
Podfile.lock

然后我安装了项目下的所有 pod

pod install

毕竟构建正常。

希望有用

© www.soinside.com 2019 - 2024. All rights reserved.