'iOS XCFramework: How to avoid "Symbol not found" with optimistic third party library dependency?

We are distributing a XCFramework with Cocoapods, which has third party library dependencies. When implementing the XCFramework into an app with the same version of the third party library, which was used to build the XCFramework, everything works fine. When using a higher version of the third party library in the app, the app crashed during runtime with:

Symbol not found: 'SomeSymbol'
  Referenced from: 'PATH/Dependency'
  Expected in: 'PATH/Dependency'

In the Podfile of our project we define the dependency as such:


pod 'Dependency', '10.14'

In the podspec of the Pod we define the dependency as such:


spec.dependency "Dependency", '~> 10.14'

The Dependency claims that all 10.X.X are bckwards-compatible.

How to fix this error?

If this is the fault of the dependency - How to catch this error before deployment? Is there a way to check the implementation with a different third library version?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source