I'm currently evaluating Wikitude for it's Markerless AR functionality for my company and I have managed to get an existing prototype working on an Android device (we were previously using ARCore) but now I am having issues getting the plugin to work properly with our iOS implementation. I have two issues I'm struggling with right now.
1. I get a crash when the scene initialises that looks like this:
#0 0x00000001018c1874 in ::-[WTWikitude2UnityBridge initWithLicenseKey:andTrackerManagerName:andUnityGraphics:andUnityGraphicsMetal:](NSString *, NSString *, IUnityGraphics *, IUnityGraphicsMetal *) at /Users/emperor/Development/Tools/Jenkins/Master/Instance/jobs/native_sdk_builder/workspace/repositories/unity_plugin/src/ios/Wikitude2UnityBridge/WTWikitude2UnityBridge.mm:98
#1 0x00000001018bf640 in ::UnityWikitudeBridge_InstantiateWikitudeNativeSDK(const char *, const char *) at /Users/emperor/Development/Tools/Jenkins/Master/Instance/jobs/native_sdk_builder/workspace/repositories/unity_plugin/src/ios/Wikitude2UnityBridge/WTGlobalUnityBridge.mm:88
#2 0x000000010088dd9c in ::iOSBridge_UnityWikitudeBridge_InstantiateWikitudeNativeSDK_m2397249553(Il2CppObject *, String_t *, String_t *, const MethodInfo *) at /Users/jonathanmurphy/Documents/Development/psm-prototype/Build/Classes/Native/Bulk_WikitudeUnityPlugin_0.cpp:7993
#3 0x000000010088ed38 in ::iOSBridge_Wikitude_IPlatformBridge_InstantiateWikitudeNativeSDK_m2737054127(iOSBridge_t3713850486 *, String_t *, String_t *, const MethodInfo *) at /Users/jonathanmurphy/Documents/Development/psm-prototype/Build/Classes/Native/Bulk_WikitudeUnityPlugin_0.cpp:8838
#4 0x00000001008a1a08 in InterfaceActionInvoker2<String_t*, String_t*>::Invoke(unsigned int, Il2CppClass*, Il2CppObject*, String_t*, String_t*) at /Users/jonathanmurphy/Documents/Development/psm-prototype/Build/Classes/Native/GeneratedInterfaceInvokers.h:69
#5 0x00000001008acf88 in ::WikitudeCamera_Awake_m535637355(WikitudeCamera_t2517845841 *, const MethodInfo *) at /Users/jonathanmurphy/Documents/Development/psm-prototype/Build/Classes/Native/Bulk_WikitudeUnityPlugin_0.cpp:19612
#6 0x0000000100ca1c2c in RuntimeInvoker_Void_t1841601450(MethodInfo const*, void*, void**) at /Users/jonathanmurphy/Documents/Development/psm-prototype/Build/Classes/Native/Il2CppInvokerTable.cpp:1506
I am able to get the Sample project compiling fine but I'm just unsure how my Project is setup differently, I have the license key entered correctly and the settings for Graphics rendering seem the same (Metal, OpenGLES3, OpenGLES2).
2. Every time I export from Unity I need to manually add WikitudeNativeSDK.Framework to the Embedded Binaries section of the build settings. This is breaking our Jenkins CI as I can't really find an automated way of doing this in Unity 5.6.3f1. This may be fixable with some more work but are there any existing to this?
I would love to recommend this package for our companies needs but right now it's hard to recommend. Any help would be much appreciated.
Also, please keep in mind that the code assumes that it is modifying a new (clean) build from Unity and it is not appending to an existing one. If you try to run it on an existing Xcode project, it will try to add the framework multiple times.
I've attached our version of the Xcode API project to this post.
Alongside the usual files, you will find the XcodeUpdater.cs script, that demonstrates how the API can be used to modify a Unity Xcode project to work with Wikitude without any modifications.
It is configured to run as a PosProcessBuild method, but it also provides a way to manually trigger it from a menu command, as long as you change the hardcoded path to the Xcode project in the TestXcode method. I've found this useful for testing.
All the code is in the Wikitude.Xcode namespace, but feel free to modify that to your needs.
If you have any issues integrating this, please let me know.
I managed to fix the compile/missing library issue, it was due to I guess a shonky update of the libWikitude2UnityBridge meta file when it auto-updated from 5.4 to 5.6, meaning the library wasn't being fully included into the iOS build. Regenerating the meta file seems to have fixed those woes.
Would still love to see your implementation of xcodeapi for automatically adding the embedded framework at export though.
Unfortunately my company is very secretive so I don't think sending you this project right now would be acceptable but I can look into it. I'll see what I can come up with further investigation, I am now in the process of basically stripping the project back until it works again and I'll see what I can find out.
Using the modified xcodeapi sounds like a fine solution, if you would share it, it would at least speed up my testing considerably. :) Can you share it through here?
Since the sample project doesn't have the same issue, it would be very helpful if you could send us your project to debug, or a simplified version of it that still has the same problem. If you are not comfortable posting it in the forum, you can send it to the support email, mentioning this post and I will find it there.
As for CI integration, the only way we've found to work around this limitation in older versions of Unity is to modify the XcodeAPI project from Unity. You can find the project here:
If you want to go with this solution, we can share our version of the XcodeAPI that we use to build internally.
For 2017.2 and higher, it is possible to do the same thing using the API that is shipped with Unity. Please see the last post in this thread for an example on how to do this: