-
新建时不要新建Flutter工程,新建一个Flutter module
$ flutter create -t module xxx
-
使用pod导入flutter的时候发现下面两句话pod install不管用
flutter_application_path = '../flutter_module'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
解决方法:
把podfile改成如下,之后运行pod install
platform :ios, '9.0'
use_frameworks!
flutter_application_path = '../flutter_module/'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'flutter_ios_navative' do
install_all_flutter_pods(flutter_application_path)
end
-
编译时pod报错
解决方法:
把对应framework的bitcode关掉
-
编译或打包时报错Flutter.framework: Permission denied
解决方法:
你的flutter目录/flutter/packages/flutter_tools/bin/xcode_backend.sh
打开sh文件 编辑第144行
#RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec chmod a-w "{}" \;
#改成
RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -iname '.h' -exec chmod a-w "{}" \;