iOS开发小抄程序猿的纸条屋

Undefined symbol: _OBJC_CLASS_$_

2022-07-01  本文已影响0人  zhangyin

岁数大了,记忆力不好,特记录下来已备后查~
记录时间:2022/7/1

事故现场

Xcode版本:Version 13.4 (13F17a)
项目使用 New Build System 编译

Flutter版本:
Flutter 3.0.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision fb57da5f94 (6 weeks ago) • 2022-05-19 15:50:29 -0700
Engine • revision caaafc5604
Tools • Dart 2.17.1 • DevTools 2.12.2

问题描述

项目是Flutter + iOS Native 混编的;
在flutter项目中引用了 scan 插件;
dart代码更新后,在Native APP 项目中进行pod install,然后build native App,系统报错:

Showing Recent Messages
Undefined symbol: OBJC_CLASS$_ScanPlugin

解决方案

(1)在Native APP的target 中,设置Excluded Architectures, 在Debug模式中设置:

Any iOS Simulator SDK 为 : arm64
意思是在模拟器运行项目的时候,不要包含 arm64的架构;

3541656634174_.pic.jpg

(2)在APP的Pod项目的target中进行同样的设置;

3551656634370_.pic.jpg

(3)在 Native APP 项目中引用的 Pod项目的Development Pods 中找到 scan 插件项目,设置项目应的Excluded Architectures

设置方法:
在Native的Pod项目中,找到scan插项目,scan > Support Files > scan.debug,
然后打开scan.debug文件,在文件中找到:EXCLUDED_ARCHS[sdk=iphonesimulator*] 这个配置项,设置为 arm64,意思是在模拟器运行项目的时候,不要包含 arm64的架构;

设置完成后重新build Native 项目,build success,bingo~

上一篇下一篇

猜你喜欢

热点阅读