CaiJingLong / add_flutter_to_exists_ios_example

21 stars 2 forks source link

你好,下载下来报错了,因为我是Android 开发人员,弄了两天都没有成功导入。 #1

Open nianzhen opened 5 years ago

nianzhen commented 5 years ago

本地的Flutter版本:1.7.8.hotfix3,xcode版本:Version 10.3 用的是模拟器 iphone xs max 错误信息如下: ld: warning: ld: warning: ignoring file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/App.framework/App, missing required architecture x86_64 in file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/App.framework/App (2 slices) ld: warning: ignoring file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/FlutterPluginRegistrant.framework/FlutterPluginRegistrant, missing required architecture x86_64 in file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/FlutterPluginRegistrant.framework/FlutterPluginRegistrant (2 slices) ld: warning: ignoring file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/shared_preferences.framework/shared_preferences, missing required architecture x86_64 in file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/shared_preferences.framework/shared_preferences (2 slices) ignoring file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/path_provider.framework/path_provider, missing required architecture x86_64 in file /Users/xxxx/Desktop/testFlutter/flutter-lib/ios_frameworks/path_provider.framework/path_provider (2 slices) Undefined symbols for architecture x86_64: "_OBJCCLASS$_GeneratedPluginRegistrant", referenced from: objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

希望能帮忙一下,十分感谢。

ericzhou2008 commented 4 years ago

用真机调试,Flutter SDK为1.10前的版本因为Flutter.framework做了签名导致签名冲突,进到文件里将_CodeSignature文件删除即可 模拟器问题我也还没解决

huainanzi commented 4 years ago

用真机调试,Flutter SDK为1.10前的版本因为Flutter.framework做了签名导致签名冲突,进到文件里将_CodeSignature文件删除即可 模拟器问题我也还没解决 你好,我现在flutter环境是1.17.3,我用你文章的方法中的脚本生成framework.不管flutter build ios --debug --no-codesign还是flutter build ios --relsease --no-codesign都还是报这个错误,现在有解决方案吗?求助

ericzhou2008 commented 4 years ago

用真机调试,Flutter SDK为1.10前的版本因为Flutter.framework做了签名导致签名冲突,进到文件里将_CodeSignature文件删除即可 模拟器问题我也还没解决 你好,我现在flutter环境是1.17.3,我用你文章的方法中的脚本生成framework.不管flutter build ios --debug --no-codesign还是flutter build ios --relsease --no-codesign都还是报这个错误,现在有解决方案吗?求助

我们是把flutter做成SDK,原理就是在flutter build ios --release --no-codesign后flutterSDK会生成一些中间文件比如:.ios和build文件夹,可以获取Flutter.framework,App.framework等framework,把所有生成的framework集成到原有工程里就行了 展示flutter代码关键代码如下: [flutterVC setInitialRoute:route]; [self.rootNaviVC pushViewController:flutterVC animated:YES]; 其中route为native传给flutter的一些参数, 可以是一个JSON字符串,flutterVC为FlutterViewController实例