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

Posted

技术标签:

【中文标题】Firebase - 使用未声明的标识符“FIRAnalyticsConfiguration”【英文标题】:Firebase - Use of undeclared identifier 'FIRAnalyticsConfiguration' 【发布时间】:2021-01-29 22:00:38 【问题描述】:

我正在尝试使用 Xcode 版本 12.3 (12C33) 在 ios 上使用 Firebase 编译 Ionic 3 应用程序。

即使使用 Podfile 中的模块,由于某种原因,它仍然会给出 'Use of undeclared identifier 'FIRAnalyticsConfiguration'

我做错了什么?一切看起来都更新了。

使用的命令:

ionic cordova platform rm ios && ionic cordova platform add ios && cd platforms/ios/ && pod deintegrate && pod cache clean --all && pod install

release.xxconfig

CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_ROOT/FirebaseAnalytics/Frameworks" "$PODS_ROOT/GoogleAppMeasurement/Frameworks" "$PODS_XCFRAMEWORKS_BUILD_DIR/FirebaseAnalytics" "$PODS_XCFRAMEWORKS_BUILD_DIR/GoogleAppMeasurement"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
HEADER_SEARCH_PATHS = $(inherited) "$PODS_ROOT/Headers/Public" "$PODS_ROOT/Headers/Public/Firebase" "$PODS_ROOT/Headers/Public/FirebaseCore" "$PODS_ROOT/Headers/Public/FirebaseCoreDiagnostics" "$PODS_ROOT/Headers/Public/FirebaseInstallations" "$PODS_ROOT/Headers/Public/GoogleDataTransport" "$PODS_ROOT/Headers/Public/GoogleUtilities" "$PODS_ROOT/Headers/Public/PromisesObjC" "$PODS_ROOT/Headers/Public/nanopb" $(inherited) $PODS_ROOT/Firebase/CoreOnly/Sources "$PODS_TARGET_SRCROOT/Sources/FBLPromises/include"
LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FirebaseCore" "$PODS_CONFIGURATION_BUILD_DIR/FirebaseCoreDiagnostics" "$PODS_CONFIGURATION_BUILD_DIR/FirebaseInstallations" "$PODS_CONFIGURATION_BUILD_DIR/GoogleDataTransport" "$PODS_CONFIGURATION_BUILD_DIR/GoogleUtilities" "$PODS_CONFIGURATION_BUILD_DIR/PromisesObjC" "$PODS_CONFIGURATION_BUILD_DIR/nanopb"
cPODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = $SRCROOT/.
PODS_ROOT = $SRCROOT/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Podfile:

source 'https://cdn.cocoapods.org/'
platform :ios, '12.0'

target 'Motok' do
    project 'Motok.xcodeproj'
    pod 'Firebase/Analytics', '~> 7.5.0'
end

Pod 版本:

user189648$ pod --version
1.10.1

离子信息

$ ionic info

Ionic:

   Ionic CLI          : 6.12.2 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : ios 6.1.1
   Cordova Plugins   : no whitelisted plugins (27 plugins total)

Utility:

   cordova-res (update available: 0.15.2) : 0.8.1
   native-run                             : not installed

System:

   NodeJS : v14.15.0 (/usr/local/bin/node)
   npm    : 6.14.9
   OS     : macOS Catalina

package.json

  "dependencies": 
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@firebase/app": "^0.6.13",
    "@ionic-native/admob-free": "^4.20.0",
    "@ionic-native/android-permissions": "^4.17.0",
    "@ionic-native/background-mode": "^3.1.0-rc.1",
    "@ionic-native/camera": "^5.31.1",
    "@ionic-native/core": "^5.31.1",
    "@ionic-native/fcm": "^5.31.1",
    "@ionic-native/firebase": "^5.31.1",
    "@ionic-native/firebase-crash": "^5.0.0",
    "@ionic-native/geolocation": "^4.20.0",
    "@ionic-native/google-maps": "^4.14.0",
    "@ionic-native/in-app-browser": "^5.31.1",
    "@ionic-native/launch-navigator": "^4.20.0",
    "@ionic-native/location-accuracy": "^4.20.0",
    "@ionic-native/native-audio": "^5.31.1",
    "@ionic-native/push": "^5.31.1",
    "@ionic-native/screen-orientation": "^4.20.0",
    "@ionic-native/social-sharing": "^5.31.1",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "4.7.0",
    "@ionic-native/vibration": "^5.31.1",
    "@ionic/pro": "^2.0.3",
    "@ionic/storage": "2.1.3",
    "@ngx-translate/core": "10.0.1",
    "@ngx-translate/http-loader": "^3.0.1",
    "@types/googlemaps": "3.26.15",
    "add": "2.0.6",
    "angular-calendar": "^0.25.2",
    "angular-calendar-week-hours-view": "^1.0.2",
    "angular-elastic": "^2.5.1",
    "angularfire2": "^5.1.1",
    "animate.css": "^3.7.0",
    "browser": "0.2.6",
    "clean": "4.0.2",
    "compare-func": "^2.0.0",
    "cordova-admob-sdk": "0.24.1",
    "cordova-browser": "5.0.4",
    "cordova-plugin-actionsheet": "^2.3.3",
    "cordova-plugin-android-permissions": "^1.0.2",
    "cordova-plugin-androidx": "^1.0.2",
    "cordova-plugin-androidx-adapter": "^1.1.0",
    "cordova-plugin-bring-to-front": "0.0.3",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-dialogs": "^2.0.2",
    "cordova-plugin-filechooser": "^1.2.0",
    "cordova-plugin-firebase-lib": "^5.0.0",
    "cordova-plugin-geolocation": "^4.0.2",
    "cordova-plugin-googlemaps": "^2.6.2",
    "cordova-plugin-ionic": "^4.2.0",
    "cordova-plugin-nativeaudio": "^3.0.9",
    "cordova-plugin-request-location-accuracy": "^2.3.0",
    "cordova-plugin-screen-orientation": "^3.0.2",
    "cordova-plugin-vibration": "^3.1.1",
    "cordova-plugin-x-socialsharing": "^5.6.2",
    "cordova-plugin-youtube-video-player": "^1.0.6",
    "cordova-promise-polyfill": "0.0.2",
    "cordova-res": "^0.8.1",
    "cordova-support-android-plugin": "^1.0.1",
    "cordova-support-google-services": "^1.4.1",
    "core-js": "^3.8.3",
    "css-animator": "^2.3.1",
    "date-fns": "^1.29.0",
    "default-passive-events": "^1.0.10",
    "es6-promise": "^4.2.8",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^8.0.0",
    "firebase-config": "0.0.2",
    "firebase-functions": "^3.13.1",
    "firebase-tools": "^9.0.1",
    "geolocation-marker": "^2.0.5",
    "grpc": "^1.24.2",
    "install": "^0.11.2",
    "intl": "^1.2.5",
    "ionic-angular": "3.9.2",
    "ionic2-calendar": "^0.4.6",
    "ionic2-rating": "^1.2.2",
    "ionicons": "4.1.1",
    "marker-animate-unobtrusive": "^0.2.8",
    "minimist": "^1.2.0",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.32",
    "mydatepicker": "^2.6.11",
    "node-properties-parser": "0.0.2",
    "node-sass": "^4.14.1",
    "promise-polyfill": "8.2.0",
    "rxjs": "6.3.3",
    "rxjs-compat": "6.3.3",
    "shelljs": "^0.8.4",
    "signature_pad": "^3.0.0-beta.4",
    "sw-toolbox": "3.6.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "^5.0.4",
    "xml-js": "^1.6.11",
    "zone.js": "0.8.29"
  ,
  "devDependencies": 
    "@ionic/app-scripts": "3.2.3",
    "cordova-android": "^9.0.0",
    "cordova-bring-to-front": "git+https://github.com/markeeftb/cordova-bring-to-front.git",
    "cordova-ios": "^6.1.1",
    "cordova-plugin-add-swift-support": "^2.0.2",
    "cordova-plugin-admob-free": "^0.27.0",
    "cordova-plugin-background-mode": "git+https://github.com/katzer/cordova-plugin-background-mode.git",
    "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
    "cordova-plugin-inappbrowser": "git+https://github.com/apache/cordova-plugin-inappbrowser.git",
    "cordova-plugin-nativeaudio": "^3.0.9",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "typescript": "^2.9.2"
  ,
  "description": "Aplicativo de entregas e moto táxi",
  "cordova": 
    "plugins": 
      "cordova-plugin-youtube-video-player": ,
      "cordova-plugin-x-socialsharing": 
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
        "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "Precisamos de acesso para tirar fotos e abrir album. Usaremos essa imagem no perfil de acesso do user.",
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "Precisamos de acesso para tirar fotos e abrir album. Usaremos essa imagem no perfil de acesso do user."
      ,
      "cordova-plugin-device": ,
      "cordova-plugin-splashscreen": ,
      "cordova-plugin-whitelist": ,
      "cordova-plugin-camera": 
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      ,
      "cordova-plugin-geolocation": 
        "GEOLOCATION_USAGE_DESCRIPTION": "To locate you",
        "GPS_REQUIRED": "true"
      ,
      "cordova-plugin-filechooser": ,
      "cordova-plugin-googlemaps": 
        "API_KEY_FOR_ANDROID": "xxxxxxxxxx",
        "API_KEY_FOR_IOS": "xxxxxxxxx",
        "PLAY_SERVICES_VERSION": "15.0.1",
        "ANDROID_SUPPORT_V4_VERSION": "27.+",
        "LOCATION_WHEN_IN_USE_DESCRIPTION": "This app wants to get your location while this app runs only.",
        "LOCATION_ALWAYS_USAGE_DESCRIPTION": "This app wants to get your location always, even this app runs in background."
      ,
      "cordova-plugin-file": ,
      "cordova-support-google-services": ,
      "cordova-plugin-statusbar": ,
      "cordova-plugin-android-permissions": ,
      "cordova-plugin-firebase-lib": ,
      "cordova-plugin-androidx": ,
      "cordova-plugin-androidx-adapter": ,
      "cordova-plugin-nativeaudio": ,
      "cordova-plugin-vibration": ,
      "cordova-plugin-background-mode": ,
      "in.lucasdup.bringtofront": ,
      "uk.co.workingedge.phonegap.plugin.launchnavigator": 
        "GOOGLE_API_KEY_FOR_ANDROID": "xxxxxxxxxxx",
        "OKHTTP_VERSION": "3.12.0",
        "LOCATION_USAGE_DESCRIPTION": "Precisamos de acesso a sua  localizacao para enviar e receber chamados"
      ,
      "cordova-plugin-request-location-accuracy": ,
      "cordova-plugin-screen-orientation": ,
      "cordova-plugin-admob-free": 
        "ADMOB_APP_ID": "xxxxxxxxxxxxx"
      ,
      "cordova-admob-sdk": 
        "PLAY_SERVICES_VERSION": "17.+"
      ,
      "cordova-plugin-add-swift-support": ,
      "cordova-plugin-inappbrowser": 
    ,
    "platforms": [
      "browser",
      "ios"
    ]
  

config.xml

<?xml version='1.0' encoding='utf-8'?>
    ...
    <plugin name="cordova-plugin-youtube-video-player" spec="^1.0.6" />
    <plugin name="cordova-plugin-x-socialsharing" spec="^5.6.2">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
        <variable name="PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION" value="Precisamos de acesso para tirar fotos e abrir album. Usaremos essa imagem no perfil de acesso do user." />
        <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="Precisamos de acesso para tirar fotos e abrir album. Usaremos essa imagem no perfil de acesso do user." />
    </plugin>
    <plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
    <plugin name="cordova-plugin-camera" spec="^4.1.0">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-geolocation" spec="^4.0.2">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="Precisamos de acesso para tirar fotos e abrir album. Usaremos essa imagem no perfil de acesso do user" />
    </plugin>
    <plugin name="cordova-plugin-filechooser" spec="^1.2.0" />
    <plugin name="cordova-plugin-googlemaps" spec="^2.6.2">
        <variable name="API_KEY_FOR_ANDROID" value="xxxxx" />
        <variable name="API_KEY_FOR_IOS" value="xxxxxxx" />
        <variable name="PLAY_SERVICES_VERSION" value="17.0.0" />
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-file" spec="^6.0.2" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
    <plugin name="cordova-plugin-android-permissions" spec="^1.0.2" />
    <plugin name="cordova-plugin-firebase-lib" spec="5.1.1" />
    <plugin name="cordova-plugin-androidx" spec="^1.0.2" />
    <plugin name="cordova-plugin-androidx-adapter" spec="^1.1.0" />
    <plugin name="cordova-plugin-nativeaudio" spec="^3.0.9" />
    <plugin name="cordova-plugin-vibration" spec="^3.1.1" />
    <plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^5.0.4">
        <variable name="GOOGLE_API_KEY_FOR_ANDROID" value="xxxxxx" />
        <variable name="OKHTTP_VERSION" value="3.12.0" />
        <variable name="LOCATION_USAGE_DESCRIPTION" value="Precisamos de acesso a sua  localizacao para enviar e receber chamados" />
    </plugin>
    <plugin name="cordova-plugin-request-location-accuracy" spec="^2.3.0" />
    <plugin name="cordova-plugin-screen-orientation" spec="^3.0.2" />
    <plugin name="in.lucasdup.bringtofront" spec="https://github.com/markeeftb/cordova-bring-to-front" />
    <plugin name="cordova-plugin-background-mode" spec="https://github.com/katzer/cordova-plugin-background-mode.git" />
    <plugin name="cordova-admob-sdk" spec="~0.13.1">
        <variable name="PLAY_SERVICES_VERSION" value="17.+" />
    </plugin>
</widget>

构建设置:

错误:

感谢您的帮助。谢谢。

【问题讨论】:

【参考方案1】:

根据Firebase Analytics 的发行说明FIRAnalyticsConfiguration API 在版本 6.0.0 中被删除。您可以直接在 FirebaseAnalytics 类上使用相同的 API。

【讨论】:

感谢您的回复。你知道我应该降级或升级哪个软件包吗? @DiegoDesenvolvedor 您可以将“Firebase/Analytics”的 7.5.0 版降级到 6.0.0 版,或者使用 FirebaseAnalytics API 代替 FIRAnalyticsConfiguration 发行说明中关于此的部分:firebase.google.com/support/release-notes/…

以上是关于Firebase - 使用未声明的标识符“FIRAnalyticsConfiguration”的主要内容,如果未能解决你的问题,请参考以下文章

使用未解析的标识符“InstanceID”Firebase 6.2.2

使用未解析的标识符“FIRAuth”(Swift 2、Firebase 3.x)

Swift 2.3 pod 更新后使用未解析的标识符 Firebase 'FIR'

Firebase (4.0.0):安装 FirebaseDatabase 时使用未解析的标识符 FirebaseApp

Firebase 使用电话号码进行身份验证:使用未解析的标识符 AuthAPNSTokenTypeProd 和 UIBackgroundFetchResultNoData 错误

Firebase google 登录身份验证 AppDelegate-使用未解析的标识符“isMFAEnabled”