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

Havok Issue in iOS Build

Discussion in 'Physics for ECS' started by matrixvel, Dec 14, 2019.

  1. matrixvel

    matrixvel

    Joined:
    Nov 1, 2018
    Posts:
    10
    Hi guys, I'm not sure if anyone's tried to submit a game using Havok Physics yet to the AppStore/Testflight yet but I'm running into an issue. Havok physics work beautifully when building straight to a phone and just using a development profile but the issue arises when attempting to submit a build to the Appstore. I've attached an image with the errors.

    My knowledge in this area is very limited but the issues appears to be this: "Dynamic libraries outside of a framework bundle, which typically have the file extension .dylib, are not supported on iOS, watchOS, or tvOS, except for the system Swift libraries provided by Xcode" which is explained here: https://developer.apple.com/library/archive/technotes/tn2435/_index.html

    The Havok (bundle?) after building in Unity is indeed a .dylib file. I've tried the suggested solution of converting the library to a framework but this leads to an error in a file named "hkStaticShim.cpp". Again my knowledge here is very limited and the comments at the top of that file have me guessing that the .dylib is needed as-is and won't work after converting it to a framework. The comments:

    // This file contains a trivial implementation of the plugin interfaces
    // with an additional initialization function which dynamically loads
    // the real plugin and extracts the functions we need.

    Maybe I'm setting up the framework wrong?

    Anyways I realize this may be something Havok has to address but I'm wondering if anyone here has any knowledge regarding this. Thanks for reading!
     

    Attached Files:

  2. steveeHavok

    steveeHavok

    Joined:
    Mar 19, 2019
    Posts:
    481
    Thanks for bring this up. I don't have an immediate answer for you but we'll take a look at it asap.

    FYI, we moved this thread into the specific Betas & Experimental Features > Data Oriented Technology Stack > DOTS Physics forum to more easily track.
     
  3. matrixvel

    matrixvel

    Joined:
    Nov 1, 2018
    Posts:
    10
    Awesome, thanks!
     
  4. milos85miki

    milos85miki

    Joined:
    Nov 29, 2019
    Posts:
    197
    Hi @matrixvel, sorry for the problem and thank you for bringing it up. We have switched from a dynlib to framework for the iOS plugin. New package (version 0.1.2-preview) is out, so please give it a try!

    When creating an app, please make sure the following 2 things are set:
    1. In the Project window in Unity, navigate to Packages/Havok Physics/Plugins/iOS, click on HavokNative.framework and make sure that "Add to Embedded Binaries" is checked
    2. In xCode, when project is generated (after hitting Build in Unity), set "Enable Bitcode" to "No" to match our plugin

    In parallel, we're following up with Apple to make sure the new version of the package is "AppStore-ready".
     
  5. matrixvel

    matrixvel

    Joined:
    Nov 1, 2018
    Posts:
    10
    That's great to hear, @milos85miki! I'll be trying this out soon.
     
  6. milos85miki

    milos85miki

    Joined:
    Nov 29, 2019
    Posts:
    197
    Not sure if you had time to try out the new package, just wanted to add 1 more manual step that needs to be done. These instructions should be complete:
    1. In the Project window in Unity, navigate to Packages/Havok Physics/Plugins/iOS, click on HavokNative.framework, ensure that "Add to Embedded Binaries" is checked.
    2. Still in Project window in Unity, go inside HavokNative.framework and double-click on Info.plist file. It should open a list of key-value pairs in xCode, then please set value of "Bundle version" to "1.0".
    3. When xCode project is generated (after hitting Build in Unity), set "Enable Bitcode" to "No" to match our plugin. Also ensure the arch is set to arm64.

    Please let me know if you hit any problems. We're working on making things smoother for next release, thanks for helping us with feedback!
     
  7. PlattoPavelPanzerdog

    PlattoPavelPanzerdog

    Joined:
    Jan 12, 2018
    Posts:
    2
  8. crism_unity

    crism_unity

    Unity Technologies

    Joined:
    Oct 15, 2019
    Posts:
    2
    JosepMariaPujol likes this.