Error running pod install when building iOS app (Flutter)

huangapple go评论82阅读模式
英文:

Error running pod install when building iOS app (Flutter)

问题

我在尝试运行我的应用程序(flutter run)时遇到了这个错误。这只发生在iOS上。

启动以调试模式运行iPhone 14 Pro Max上的lib/main.dart...
运行pod install... 387ms
CocoaPods的输出:
↳
      准备中

    分析依赖项

    检查要集成的目标
      使用`ARCHS`设置构建`Pods-Runner`目标的体系结构:(``)

    查找Podfile更改
      M path_provider_foundation
      M shared_preferences_foundation
      - Flutter
      - cloud_firestore
      - firebase_auth
      - firebase_core
      - flutter_native_splash
      - google_sign_in_ios

    获取外部来源
    -> 从`Flutter`获取`Flutter`的podspec
    -> 从`.symlinks/plugins/cloud_firestore/ios`获取`cloud_firestore`的podspec
    cloud_firestore: 使用Firebase SDK版本'10.10.0'定义在'firebase_core'中
    -> 从`.symlinks/plugins/firebase_auth/ios`获取`firebase_auth`的podspec
    firebase_auth: 使用Firebase SDK版本'10.10.0'定义在'firebase_core'中
    -> 从`.symlinks/plugins/firebase_core/ios`获取`firebase_core`的podspec
    firebase_core: 使用Firebase SDK版本'10.10.0'定义在'firebase_core'中
    -> 从`.symlinks/plugins/flutter_native_splash/ios`获取`flutter_native_splash`的podspec
    -> 从`.symlinks/plugins/google_sign_in_ios/ios`获取`google_sign_in_ios`的podspec
    -> 从`.symlinks/plugins/path_provider_foundation/darwin`获取`path_provider_foundation`的podspec
    -> 从`.symlinks/plugins/shared_preferences_foundation/darwin`获取`shared_preferences_foundation`的podspec

    解决`Podfile`的依赖关系
      CDN: 干线 相对路径:CocoaPods-version.yml存在!返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:all_pods_versions_4_2_c.txt存在!返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:Specs/4/2/c/FlutterMacOS/3.0.0/FlutterMacOS.podspec.json存在!
      返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:all_pods_versions_0_3_5.txt存在!返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:Specs/0/3/5/Firebase/10.11.0/Firebase.podspec.json存在!
      返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:all_pods_versions_6_1_e.txt存在!返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:Specs/6/1/e/nanopb/2.30909.0/nanopb.podspec.json存在!
      返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:all_pods_versions_d_4_0.txt存在!返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:Specs/d/4/0/GoogleSignIn/7.0.0/GoogleSignIn.podspec.json存在!
      返回本地,因为只在存储库更新时执行检查
      CDN: 干线 相对路径:Specs/0/3/5/Firebase/10.10.0/Firebase.podspec.json存在!
      返回本地,因为只在存储库更新时执行检查
    [!] CocoaPods无法找到兼容的版本以满足pod“Firebase/Firestore”的要求:
      在快照(Podfile.lock)中:
        Firebase/Firestore(= 10.3.0)

      在Podfile中:
        cloud_firestore(来自`.symlinks/plugins/cloud_firestore/ios`)解析为4.8.1,它依赖于
          Firebase/Firestore(= 10.10.0)

    您可能是:
     * 源存储库已过时,可以使用`pod repo update`或`pod install --repo-update`来更新
     * 更改了开发库`cloud_firestore`中依赖`Firebase/Firestore`的约束条件
       您应该运行`pod update Firebase/Firestore`以应用您所做的更改。

    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
    317:在“raise_error_unless_state”中引发错误
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
    299:在“unwind_for_conflict”中的块
    <internal:kernel>:90:中的“tap”
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
    297:在“unwind_for_conflict”中
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
    257:在“process_topmost_state”中
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
    182:在“resolve”中
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43
    :在“resolve”中
    /opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12

<details>
<summary>英文:</summary>

I started having this error when trying to run my app (flutter run). This only happens for iOS.


Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
Running pod install... 387ms
CocoaPods' output:

Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

Finding Podfile changes
  M path_provider_foundation
  M shared_preferences_foundation
  - Flutter
  - cloud_firestore
  - firebase_auth
  - firebase_core
  - flutter_native_splash
  - google_sign_in_ios

Fetching external sources
-&gt; Fetching podspec for `Flutter` from `Flutter`
-&gt; Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
cloud_firestore: Using Firebase SDK version &#39;10.10.0&#39; defined in &#39;firebase_core&#39;
-&gt; Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version &#39;10.10.0&#39; defined in &#39;firebase_core&#39;
-&gt; Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version &#39;10.10.0&#39; defined in &#39;firebase_core&#39;
-&gt; Fetching podspec for `flutter_native_splash` from
`.symlinks/plugins/flutter_native_splash/ios`
-&gt; Fetching podspec for `google_sign_in_ios` from `.symlinks/plugins/google_sign_in_ios/ios`
-&gt; Fetching podspec for `path_provider_foundation` from
`.symlinks/plugins/path_provider_foundation/darwin`
-&gt; Fetching podspec for `shared_preferences_foundation` from
`.symlinks/plugins/shared_preferences_foundation/darwin`

Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is
  only performed in repo update
  CDN: trunk Relative path: all_pods_versions_4_2_c.txt exists! Returning local because
  checking is only performed in repo update
  CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/3.0.0/FlutterMacOS.podspec.json exists!
  Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because
  checking is only performed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/10.11.0/Firebase.podspec.json exists!
  Returning local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_6_1_e.txt exists! Returning local because
  checking is only performed in repo update
  CDN: trunk Relative path: Specs/6/1/e/nanopb/2.30909.0/nanopb.podspec.json exists! Returning
  local because checking is only performed in repo update
  CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because
  checking is only performed in repo update
  CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/7.0.0/GoogleSignIn.podspec.json exists!
  Returning local because checking is only performed in repo update
  CDN: trunk Relative path: Specs/0/3/5/Firebase/10.10.0/Firebase.podspec.json exists!
  Returning local because checking is only performed in repo update
[!] CocoaPods could not find compatible versions for pod &quot;Firebase/Firestore&quot;:
  In snapshot (Podfile.lock):
    Firebase/Firestore (= 10.3.0)

  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 4.8.1, which
    depends on
      Firebase/Firestore (= 10.10.0)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install
 --repo-update`.
 * changed the constraints of dependency `Firebase/Firestore` inside your development pod
 `cloud_firestore`.
   You should run `pod update Firebase/Firestore` to apply changes you&#39;ve made.

/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
317:in `raise_error_unless_state&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
299:in `block in unwind_for_conflict&#39;
&lt;internal:kernel&gt;:90:in `tap&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
297:in `unwind_for_conflict&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
257:in `process_topmost_state&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:
182:in `resolve&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43
:in `resolve&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:9
4:in `resolve&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/ana
lyzer.rb:1082:in `block in resolve_dependencies&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interfac
e.rb:64:in `section&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/ana
lyzer.rb:1080:in `resolve_dependencies&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer/ana
lyzer.rb:125:in `analyze&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:
422:in `analyze&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:
244:in `block in resolve_dependencies&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/user_interfac
e.rb:64:in `section&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:
243:in `resolve_dependencies&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:
162:in `install!&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command/insta
ll.rb:52:in `run&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in
`run&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52
:in `run&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/gems/cocoapods-1.12.1/bin/pod:55:in `&lt;top
(required)&gt;&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `load&#39;
/opt/homebrew/Cellar/cocoapods/1.12.1/libexec/bin/pod:25:in `&lt;main&gt;&#39;

Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies.
To update the CocoaPods specs, run:
pod repo update

Error running pod install
Error launching application on iPhone 14 Pro Max.


Can anyone help me with this? I have been stuck here for quite some time already. I&#39;m also quite new to developing with Flutter so would appreciate detailed instructions.


Already tried pod repo update, as well as other solutions I found online such as flutter clean and pub get but they did not work

</details>


# 答案1
**得分**: 1

1. 删除项目中 ios 目录下的 Podflie.lock 文件和 Pods 目录。

2. 在 ios 目录中安装一个新的 pod 文件:

```$ cd ios```

```$ pod install --repo-update```

<details>
<summary>英文:</summary>

1. Remove the Podflie.lock file and the Pods directory in ios directory of your project.

2. Install a new pod file in ios directory

```$ cd ios```

```$ pod install --repo-update```

</details>



huangapple
  • 本文由 发表于 2023年6月22日 16:54:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76530138.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定