ios - 'Pods-Runner' 目标具有传递依赖关系,包括静态链接的二进制文件 : (. ../ios/Flutter/Flutter.framework)

标签 ios flutter

在运行 1.17.4 时升级到 flutter 版本 flutter build ios 后,我得到以下输出:

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (.../ios/Flutter/Flutter.framework)

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/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.9.3/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/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.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:590:in `validate_targets'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:158:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.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.9.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error running pod install
我试过的:
  • 按照建议删除 ios/Flutter/Flutter.framework 并运行 pod install here 没有帮助
  • s.static_framework = true 添加到 Flutter.podspec - 没有运气
  • 删除-重新创建 ios 文件夹 - 没有运气
  • use_frameworks! 中注释掉 Podfile - 导致 fatal error: '..._plugin-Swift.h' file not found
  • 等插件中的错误
  • 我也尝试降级 flutter ,因为我对上一个没有任何问题。但是运行 flutter version v1.17.2 导致错误:
  • Error: ProcessException: Process exited abnormally:
    error: unsupported sort specification 'creatordate'
    
    我坚持这一点,所以任何帮助克服这个问题将不胜感激

    最佳答案

    嘿这个错误输出我遇到了同样的问题:

    [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
        (/.../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>'
    
    但我已经通过尝试这一步解决了问题:
  • 在你的项目中打开你的文件夹 ios 并打开 Podfile 你会看到这样的代码:
  • target 'Runner' do
      use_frameworks!
      use_modular_headers!
    
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
      end
    end
    
  • 您可以删除代码 use_frameworks!use_modular_headers!,这是完整的代码:
  • target 'Runner' do
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
      end
    end
    
  • 如果你有按照说明你可以保存更改文件并点击 flutter run
  • 这是完整的输出:
  • Running pod install...                                              3.1s
    Running Xcode build...                                                  
     └─Compiling, linking and signing...                        28.0s
    Xcode build done.                                           73.0s
    Waiting for iPhone 12 Pro Max to report its views...                19ms
    Syncing files to device iPhone 12 Pro Max...                     1,218ms
    
    Flutter run key commands.
    r Hot reload. 🔥🔥🔥
    R Hot restart.
    h Repeat this help message.
    d Detach (terminate "flutter run" but leave application running).
    c Clear the screen
    q Quit (terminate the application on the device).
    An Observatory debugger and profiler on iPhone 12 Pro Max is available at: http://127.0.0.1:50854/VhaUEREqLb0=/
    
    祝你好运!

    关于ios - 'Pods-Runner' 目标具有传递依赖关系,包括静态链接的二进制文件 : (. ../ios/Flutter/Flutter.framework),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62535230/

    相关文章:

    ios - performSelector:withObject:afterDelay: 在 NSOperation 中

    ios - Xcode Command/usr/bin/codesign 失败,退出代码 1 : errSecInternalComponent

    string - 从 ".txt"文件中获取文本并将其保存在字符串变量 dart 中

    dart - 如果手势超出Flutter中的容器范围,如何取消手势

    flutter - 没有应用栏的抽屉 Flutter

    objective-c - 关于 iOS 本地通知的问题

    ios - 在 block 中分配NSString变量时出错

    ios - 尝试使用闭包在 ViewController 之间传递数据时我犯了什么错误?

    android - 将 Realm android 添加到 flutter 项目中不起作用

    flutter - var 和 final 变量中的 UI 实现部分之间的区别