Leanplum-iOS-SDK icon indicating copy to clipboard operation
Leanplum-iOS-SDK copied to clipboard

Ambiguity between the module name and a class in the module emits errors when using the module

Open byohay opened this issue 2 years ago • 0 comments

Trying to use the static precompiled xcframework emits errors like: 'LeanplumShouldHandleNotificationBlock' is not a member type of class 'Leanplum.Leanplum' from file arm64-apple-ios-simulator.swiftinterface. I believe this stems from an ambiguity between the name of the module and that of the class, both named Leanplum. See here for a description of the problem.

There are several workarounds discussed there, in particular removing all references to Leanplum module works: find . -name "*.swiftinterface" -exec sed -i -e 's/Leanplum\.//g' {} \;

However, I think that a more robust solution would be to rename the class or the module.

Steps to Reproduce the Problem

It's tricky to reproduce the problem, as the client doesn't always tries to read the module interface. However, as suggested in the issue I referenced earlier, adding -verify-emitted-module-interface to OTHER_SWIFT_FLAGS in the SDK will make sure the module interfaces are readable when they're emitted.

byohay avatar Jun 21 '22 08:06 byohay