【问题标题】:Flutter Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2Flutter 忽略 ffi-1.12.2,因为它的扩展没有构建。试试: gem pristine ffi --version 1.12.2
【发布时间】:2021-03-30 22:03:51
【问题描述】:

当我尝试将 Flutter 项目 构建到 IOS 时,它显示此错误,我尝试清理并尝试更改项目目录。 p>

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

    [!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..

     #  from /Users/eapple/Downloads/codecanyon-IRJuYEQd-delivery-boy-for-multirestaurants-flutter-app/flutter_application/ios/Podfile:43
     #  -------------------------------------------
     #  
     >  post_install do |installer|
     #    installer.pods_project.targets.each do |target|
     #  -------------------------------------------

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:301:in `rescue in block in from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:295:in `block in from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:50:in `instance_eval'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:50:in `initialize'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:293:in `new'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:293:in `from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.1/lib/cocoapods-core/podfile.rb:259:in `from_file'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/config.rb:200:in `podfile'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:150:in `verify_podfile_exists!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:46: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.1/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error output from CocoaPods: ↳
    Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
Error running pod install
Error launching application on iPhone 12 Pro Max.

这是 pubspec.yaml 文件

  cupertino_icons: 0.1.2
  google_maps_flutter: 0.5.27
  mvc_pattern: 5.1.1
  global_configuration: 1.5.0
  http: 0.12.1
  html: 0.14.0+3
  shared_preferences: 0.5.7
  flutter_html: 0.11.1
  location: 3.0.2
  url_launcher: 5.4.5
  firebase_messaging: 6.0.13
  cached_network_image: 2.2.0
  fluttertoast: 4.0.1

我尝试过的事情,来自常识和其他各种堆栈问题:

  • flutter clean

  • 将此添加到ios/Podfile

    post_install do |installer|
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.0'
           end
         end
      end
    
  • flutter pub get

  • 安装gem install ffi --version 1.13.1 --user-install

【问题讨论】:

  • 见我的biteinteractive.com/how-to-get-started-with-pods。您需要停止使用系统 ruby​​ 并安装自己的。
  • @matt 感谢您的关注,我正在使用颤振,所以我还应该安装 Ruby 吗?
  • 您好 Umer,您是否尝试过取消注释 line platform: iOS, '9.0' on your Podfile
  • 是的,我试过了,但出现了新错误

标签: ios flutter flutter-ios


【解决方案1】:

我建议尝试运行日志中提到的gem pristine ffi --version 1.12.2,看看它是否有效。这个问题好像和这个existing Stack Overflow post类似。

【讨论】:

    猜你喜欢
    • 2021-02-18
    • 1970-01-01
    • 2019-01-29
    • 2017-01-30
    • 1970-01-01
    • 2018-04-13
    • 1970-01-01
    • 1970-01-01
    • 2016-12-12
    相关资源
    最近更新 更多