zoukankan      html  css  js  c++  java
  • iOS项目中集成Flutter的最新适配升级

    如果你在2019年8月之前将Flutter添加到现有iOS项目,本文值得你一看。

    2019年7月30日,合并合并请求flutter / flutter#36793之前Flutter 1.8.4-pre.21

    将Flutter添加到现有的iOS应用程序需要更改Podfile,

    并在现有Xcode项目中添加运行脚本构建阶段。

    要在此拉取请求之后更新到Flutter,您必须更改Podfile,删除“运行脚本”构建阶段,然后重新生成podhelper脚本。

    Podfile的改变

    以前,需要将以下几行添加到Podfile

    flutter_application_path = 'path/to/my_flutter/'
    eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)

    这应该更新为:

    flutter_application_path = 'path/to/my_flutter/'
      load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
    
      target 'MyApp' do
        install_all_flutter_pods(flutter_application_path)
      end
      target 'MyAppTests' do
        install_all_flutter_pods(flutter_application_path)
      end

    构建阶段,用于构建Dart代码

    以前,需要将构建阶段添加到现有Xcode项目中:

    "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build
    "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed

    此构建阶段不再是必需的,必须删除。

    重新生成podhelper.rb

    cd 'path/to/my_flutter/'
    rm .ios/Flutter/podhelper.rb
    flutter build ios
  • 相关阅读:
    jxl将list导入到Excel中供下载
    秒转为时分秒格式js
    秒转为时分秒格式
    加载样式js
    myeclipse:web项目不能显示Web App Libraries
    myeclipse出现src作为报名一部分src.com.*
    top命令
    Linux编写一个C程序HelloWorld
    前端jsp页面script引入url项目名使用${appName}
    流量监控iftop安装-CentOS7
  • 原文地址:https://www.cnblogs.com/jukaiit/p/12181184.html
Copyright © 2011-2022 走看看