2020-04-27
iOS OC原生Fluttter配置环境,以及接入flutter_module 1
官方Flutter链接地址https://flutterchina.club/setup-macos/
1.去flutter官网下载其最新可用的安装包,https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos。
2.解压安装包到你想安装的目录,如:
cd~/development
unzip ~/Downloads/flutter_macos_v0.5.1-beta.zip
3.更新环境变量
(1) 创建bash_profile 可以查看https://blog.csdn.net/huxinguang_ios/article/details/78709428
(2)添加以下行并更改[PATH_TO_FLUTTER_GIT_DIRECTORY]为克隆Flutter的git repo的路径
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/zhengbao/Documents/development/flutter/bin:$PATH
注意:PATH_TO_FLUTTER_GIT_DIRECTORY 为你flutter的路径,比如“~/document/code”
(3)通过运行flutter/bin命令验证目录是否在已经在PATH中:echo $PATH
4.安装Android Studio 官方链接http://www.android-studio.org/
5.安装visual studio code 官方链接https://code.visualstudio.com/
6.创建平级项目工程例如:
7.将在flutter_module文件下的.ios文件删除
8.将flutter_module拖入安装好的visual studio code,执行flutter pub get或者flutter run
9.打开终端,cd /Users/zhengbao/Desktop/test/daliangjioayi
10.在项目podfile文件下添加flutter_module地址路径
flutter_application_path ='../flutter_module/'
load File.join(flutter_application_path,'.ios','Flutter','podhelper.rb')
1install_all_flutter_pods(flutter_application_path)
11. 执行pod install
12.查看pod 下的目录是否包含flutterSDK
13.至此pod 环境下导入flutter_module完成