美文网首页
运行Flutter SDK中的examples报错

运行Flutter SDK中的examples报错

作者: 骑马纵天下 | 来源:发表于2019-08-20 14:40 被阅读0次
    Warning: CocoaPods minimum required version 1.6.0 or greater not installed. Skipping pod install.
      CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
      Without CocoaPods, plugins will not work on iOS or macOS.
      For more info, see https://flutter.dev/platform-plugins
    To upgrade:
      brew upgrade cocoapods
      pod setup
      
    Running Xcode build...
    Xcode build done.                                            1.4s
    Failed to build iOS app
    Error output from Xcode build:
    ↳
        ** BUILD FAILED **
    
    Could not build the application for the simulator.
    Error launching application on iPhone 8.
    

    刚装flutter环境是就警告CocoaPods版本太低,但是没放在心上,觉得应该会适配。但是一运行Flutter SDK中的examples就直接构建失败,觉得应该是CocoaPods版本太低导致Xcode编译的时候不兼容才失败。

    更新CocoaPods

    1. 检测gem版本

    如果gem版本小于2.6.0,则需要更新gem 更新gem请自行百度
    $ gem -v
    
    leon:~ huanghaipo$ gem -v
    2.6.13 我的是2.6.13
    

    2. 查看ruby源 确保是国内的镜像源

    $ gem sources -l
    
    leon:~ huanghaipo$  gem sources -l
    *** CURRENT SOURCES ***
    
    https://gems.ruby-china.com
    

    3. 更新cocoapods

    $ gem install cocoapods -n /usr/local/bin
    //查看更新后的版本 更新速度很快
    leon:~ huanghaipo$ pod --version
    1.7.5
    

    相关文章

      网友评论

          本文标题:运行Flutter SDK中的examples报错

          本文链接:https://www.haomeiwen.com/subject/nprpsctx.html