Havok Issue in iOS Build

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: Technical Note TN2435: Embedding Frameworks In An App

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!

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.

Awesome, thanks!

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:

  • 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

  • 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”.

That’s great to hear, @milos85miki ! I’ll be trying this out soon.

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!

Hello! We have the same issue now: Linker errors during iOS build with Havok because after 1.0 version the package again uses .dylib. Maybe it was an error to change framework back to dylib?

Hi all, this issue is being tracked via this public issue:

1 Like