Undefined symbol: _swift_getOpaqueTypeConformance - React Native & SwiftUI

Viewed 1812

I'm trying to port a SwiftUI view into react native following this guide. It build fine in swift project but not in a react native project.

I'm getting the following error:

Undefined symbols for architecture x86_64:
  "_swift_getOpaqueTypeConformance", referenced from:
      lava.ColorWheelView.body.getter : some in ColorWheelView.o
      closure #2 (SwiftUI.GeometryProxy) -> <<opaque return type of lava.ColorWheelView.makeView(SwiftUI.GeometryProxy) -> some>>.0 in lava.ColorWheelView.body.getter : some in ColorWheelView.o
      associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.ColorWheelView : SwiftUI.View in lava in ColorWheelView.o
      l_get_witness_table qd0__7SwiftUI4ViewHD3_AaBPAAE7gesture_9includingQrqd___AA11GestureMaskVtAA0F0Rd__lFQOyAA15ModifiedContentVyAA6ZStackVyAA05TupleC0VyAJyAA06_ShapeC0VyAA9RectangleVAA5ColorVGAA12_FrameLayoutVG_AJy4lava010GuitarPickC0VAA13_OffsetEffectVGtGGAA09_PositionP0VG_AA06_EndedF0VyAA0f5StateF0VyAA08_ChangedF0VyAA04DragF0VGSo7CGPointVSgGGQo_HO in ColorWheelView.o
      associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.TrianglePath : SwiftUI.View in lava in GuitarPickView.o
      associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.GuitarPickView : SwiftUI.View in lava in GuitarPickView.o
  "_swift_getTypeByMangledNameInContextInMetadataState", referenced from:
      ___swift_instantiateConcreteTypeFromMangledNameAbstract in ColorWheelView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To reproduce I made this Github repo

Copy those files in a react native project and try to build. Make sure to replace the header file import with your test project name "<Replace This>-Swift.h"

My build target is iOS 13.5 iPhone 11 Pro Max simulator.

0 Answers
Related