13

I've started using AppTrackingTransparency framework with XCode 12 and my app works fine on iOS 14 but when I start my app on iOS 13 I get next error:

dyld: Library not loaded: /System/Library/Frameworks/AppTrackingTransparency.framework/AppTrackingTransparency

I think that because there is no this framework on previous iOS versions but it is linked to my app so how to link this framework on iOS 14 and above only?

iUrii
  • 11,742
  • 1
  • 33
  • 48

2 Answers2

25

To support older iOS versions just go to Build Phases -> Link Binary With Libraries and make AppTrackingTransparency framework status as Optional:

enter image description here

In this case the framework will be loaded if only it's available on iOS.

iUrii
  • 11,742
  • 1
  • 33
  • 48
  • What if there was no item for AppTrackingTransparency .framework and it was building and submitting properly, should we add it? – androidguy Apr 25 '21 at 01:49
5
  1. Target > General > Frameworks, Libraries, and Embedded Content and add "AppTrackingTransparency.framework".

  2. Target > Build Phases > Link Binary With Libraries and make AppTrackingTransparency.framework status as Optional.

Irwin
  • 51
  • 2