**Debug Build Issue: App Crashes on Device Due to Manual Merge in Mergeable Libraries**

If I use the manual merge option with a mergeable library in debug mode, the app crashes on the device only.

Here's what I found when debugging this issue.

Problem situation 1

In the debug build, the linker does not find the type of the Meregeable Library.

Explain the debugged result of Problem Situation 1

  • We have a type called UserAdDTO, which belongs to the B Framework. - In our project, B Framework and C Framework are mergeable libraries, and they are merged into A Framework.
  • We are using Manual Merge in A Framework.
  • When we build with the simulator, we link the UserAdDTO from CFramework.framework/CFramework in the app target.

On the other hand, when I build with the device, I try to link it from AFramework.framework/AFramework, and I get the issue that UserAdDTO is not found.

  • So, even if you output DYLD_PRINT_BINDINGS, the simulator build links to the C Framework to find the UserAdDTO, but the app links to the B Framework, causing a runtime crash.

Problem situation 2

It is confirmed that only the device build does not copy the reexported binary.

Detailed description of problem situation 2

If you compare the build messages from the device build with the build messages from the release build, both generate the reexported binaries of B and C Frameworks, but do not copy them to BFramework.framework and CFramework.framework. Instead, they copy the files in different paths. This appears to be a bug, and I'd like to ask you to confirm.

**Debug Build Issue: App Crashes on Device Due to Manual Merge in Mergeable Libraries**
 
 
Q