满足“firebase_admob”的规范,但在Flutter中需要更高的最小部署目标

使用 将 firebase_admob 更新到最新版本时firebase_admob: ^0.11.0+1,我的 Flutter 应用程序停止工作,可能是 firebase 的包之间存在冲突。我正在尝试为 iOS 构建一个应用程序,但由于 cocoapods,flutter 运行失败:

我只是将 firebase 系列的两个包更新到最新版本。我正在使用的包:

firebase_admob: ^0.11.0+1
firebase_crashlytics: ^0.4.0+1

这是输出 pod install --repo-update

Updating local specs repositories

CocoaPods 1.10.1 is available.
To update use: `sudo gem install cocoapods`

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.10.1

Analyzing dependencies
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_crashlytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "firebase_admob":
  In Podfile:
    firebase_admob (from `.symlinks/plugins/firebase_admob/ios`)

Specs satisfying the `firebase_admob (from `.symlinks/plugins/firebase_admob/ios`)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

我的 iOS 设备有一些问题,但它在 android 上运行良好。我在安装 pod 时遇到错误

我已经使用 flutter dev & master 频道尝试过这个,并且遇到了同样的问题。我目前正在使用大师。我试过删除我的 Pods 文件夹并重新运行 pod install 但没有工作任何人

这是输出 flutter doctor -v

[?] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
    • Flutter version 1.22.5 at /Users/mac/Development/flutter
    • Framework revision 7891006299 (7 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

 
[?] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[?] Xcode - develop for iOS and macOS (Xcode 12.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0, Build version 12A7209
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ? Flutter plugin not installed; this adds Flutter specific functionality.
    ? Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[?] Connected device (1 available)
    • Paresh’s iPhone (mobile) • 49f62dac6f1da634e5d71981db4d591dc9126e4b • ios • iOS 13.3

! Doctor found issues in 1 category.

回答

修复 CocoaPods 兼容版本

使用较新版本的 firebase 有时需要手动运行 pod update,之后它通常会找到它需要构建的所有内容。

要解决此问题,请执行以下命令

  1. 去 Your_Project_Directory/ios/
  2. pod repo update
  3. rm -rf Podfile.lock
  4. pod update
  5. pod install
  6. flutter run

修复需要更高的最低部署目标

您只需要将 Xcode 中的 iOS 目标更新为至少10.0。这就是所有 FlutterFire 包中的版本提升的原因。Firebase admob 在最新版本上运行良好。

突破性壮举:将端口转发到 firebase-ios-sdk v7.3.0。

  • 由于这次 SDK 升级,iOS 10 现在是 FlutterFire 支持的最低版本。请更新您的构建目标版本。

要修复它,请增加您的目标版本 iOS 目标。改变你的

转到您的颤振项目。导航到 ios 并打开 Podfile 文件并将该文件的第二行替换为:

platform :ios, '12.0'platform :ios, '10.0’任何你喜欢的 >10


以上是满足“firebase_admob”的规范,但在Flutter中需要更高的最小部署目标的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>