簡體   English   中英

添加 Firebase 后 Flutter iOS 不再有效

[英]Flutter iOS no longer works after adding Firebase

運行應用程序導致錯誤。

應用程序有望在 Iphone 13 模擬器上啟動

再現輸出

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
2
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
    [!] Automatically assigning platform `iOS` with version `10.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`.
Error running pod install
Error launching application on iPhone 13.
Exited

我想是的,問題是你沒有在你的 podfile 中指定 iOS 的版本。

因此,請在您的 podfile 中指定如下版本。

platform :ios, '11.0'

在嘗試了一些建議之后,我終於找到了解決方案文檔鏈接很有幫助https://firebase.flutter.dev/docs/migration#cocoapods-could-not-find-compatible-versions-for-pod

取消注釋這一行,如果注釋platform: 9則更改為platform: 11

  1. 刪除 podfile.lock
  2. 光盤 ios/
  3. pod install --repo-update(推薦)

而已。

以防萬一您收到此警告

CocoaPods 沒有設置項目的基本配置,因為你的項目已經有一個自定義配置集。 為了讓 CocoaPods 集成正常工作,請將目標Runner的基本配置設置為Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig或包含Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig在你的構建配置中( Flutter/Release.xcconfig )。

我建議查看此鏈接Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM