Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug AppTrackingTransparency.framework issue!

Discussion in 'iOS and tvOS' started by PandaArcade, Nov 20, 2020.

  1. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    119
    If I build our project with Unity 2019.4.15f1 and Xcode 12.2 and install it on a device running...
    • iOS 13.7 everything works fine.
    • iOS 14.0 I get an error stating that the AppTrackingTransparency.framework is not linked.
    So I add the AppTrackingTransparency.framework manually in Xcode 12.2 and install it on a device running...
    • iOS 13.7 it crashes immediately on startup. No meaningful error/logs.
    • iOS 14.0 everything works fine.
    I can build our project with Unity 2019.4.15f1 and Xcode 11.7 and the project works fine on iOS 13.7 and 14.0 but how long will this remain a viable option. But with Xcode 11.7 I can't build directly to iOS 14 devices, this makes testing newer devices tedious since I have to upload to Testflight before I can play.

    Any help or advice is greatly appreciated :D

     
    Last edited: Nov 20, 2020
  2. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    119
    We're getting a lot of players reporting crashes when using iOS 14 and above. I wonder if it's because we're building with an old version of Xcode :(
     
  3. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    119
    I found a solution here... https://stackoverflow.com/a/64495060
    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.
    It would be nice if we didn't have to do this manually every time we do a new build :rolleyes:
     
  4. ltomov

    ltomov

    Joined:
    Aug 3, 2017
    Posts:
    95
    This is how to do that from inside your build script:

    project.AddFrameworkToProject(targetGUID, "AppTrackingTransparency.framework", true);

    The last parameter "true" means "Optional" in the "Link Binary With Libraries" section, "false" means "Required".
     
    PandaArcade and lupidan like this.
  5. lupidan

    lupidan

    Joined:
    Jan 14, 2014
    Posts:
    47
    As Itomov said, just add the framework optionally in your postprocessing build script.

    Rule of thumb with iOS stuff. If you need to use a new framework, introduced with a new iOS version, like AppTrackingTransparency.framework, you should always mark it as optional to support old iOS versions that do not have that framework available.