1

I have an app with deployment target iOS 9.3. I'm using the AppAuth library (appauth.io) and in the podspec it has a reference to Apples AuthenticationServices SDK. This SDK is only available from iOS 12+. Therefore it is linked with a .weak_framework reference.

But when running "pod install", the AuthenticationServices framework is embedded as required just like any other reference - not weak/optional as I expected. enter image description here

So when the app runs on devices lower than iOS 12, the app crashes with the following message:

dyld: Library not loaded: /System/Library/Frameworks/AuthenticationServices.framework/AuthenticationServices
  Referenced from: /Users/dkesbras/Library/Developer/CoreSimulator/Devices/C7AF7A0D-79A9-48C2-8619-DEF94BBD2D10/data/Containers/Bundle/Application/A2697143-C605-4E69-A1A6-9D28ADE53192/LEGOMovieMaker.app/LEGOMovieMaker
  Reason: image not found
Signal: SIGABRT (signal SIGABRT)

As per Apples article about weak linking of frameworks (https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html#//apple_ref/doc/uid/20002378-BBCJICEC), this should also be visible in the "Other Linker Flags" with the flag -weak_framework. But here it is confirmed that the framework is not correctly weakly linked. enter image description here

Do anyone have success with using AppAuth SDK on devices lower than iOS 12 or other SDKs that are utilizing the .weak_framework in cocoapods?

How do I make .weak_frameworks in a recursive podspec work, so the reference gets installed correctly as weak reference in the cocoapods project?

esbenr
  • 1,356
  • 1
  • 11
  • 34

0 Answers0