首页 > 解决方案 > 如何解决在 Flutter 上在 Iphone 11 上运行 pod install 的错误

问题描述

我知道关于这个问题有很多类似的问题,我都尝试了但没有奏效。尝试在物理设备上的 Xcode 上运行代码后,问题就开始了。错误低于我在命令行“flutter run”上说的。

Running pod install...                                           1,234ms
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

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

    Finding Podfile changes
      - Flutter
      - flutter_secure_storage
      - local_auth
      - shared_preferences
      - vibration

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `flutter_secure_storage` from `.symlinks/plugins/flutter_secure_storage/ios`
    -> Fetching podspec for `local_auth` from `.symlinks/plugins/local_auth/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
    -> Fetching podspec for `vibration` from `.symlinks/plugins/vibration/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A flutter_secure_storage
      A local_auth
      A shared_preferences
      A vibration

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing flutter_secure_storage (3.3.1)

    -> Installing local_auth (0.0.1)

    -> Installing shared_preferences (0.0.1)

    -> Installing vibration (1.7.2)
      - Running pre install hooks
    [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
    (/Users/ilkerimamoglu/Desktop/Flutter_MQTT-master 3 copy/ios/Flutter/Flutter.framework)

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in
    verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in
    verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in
    `verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:595:in `validate_targets'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:162:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/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.10.0/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error running pod install
Error launching application on iPhone 11.

即使我没有做其他事情,它也给了我这个错误。我试图删除Flutter.framework并运行pod install,但它给了我[!] No `Podfile' found in the project directory. 我该怎么办?

标签: flutterdart

解决方案


我遇到了同样的情况。这就是我找到的解决方案。 https://armen-mkrtchian.medium.com/run-cocoapods-on-apple-silicon-and-macos-big-sur-developer-transition-kit-b62acffc1387

基本上:

  • 在 Finder 中找到 Terminal.app。(应用程序->Terminal.app)
  • 右键单击并选择获取信息
  • 勾选“使用 Rosetta 打开”</li>
  • 退出终端应用程序的所有实例并再次运行它
  • 运行 sudo gem install ffi

完成上述几个步骤后,重新启动 IDE 并重新运行应用程序。


推荐阅读