报错信息
There is still an unbound symbol after generation of IR module <xxx>:
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: xxx
原因
其中一种情况是kn(比如iOS target)中使用compose,但是由于在其target中无法调用这个函数(或者调用这个函数没有意义),所以ir就不生成相应的函数,而是抛出异常
解决方案
这时有一种简单的方法,可以将报错信息提到的方法或类使用internal或private来修饰
这样就不会生成对应target中可以调用的函数了
或者使用另一种方式,就是直接加一个中间module,这样也可以解决这个问题
结语
不知道后续jb会不会处理这个问题?
可以参考官方github,也可以参考:ComposeViews/ios_shared at main · ltttttttttttt/ComposeViews (github.com)