You should be able to include the Wikitude SDK just like any other third party SDK in a Unity as a framework context.
I don't know what your current setup looks like, but you should have an Xcode workspace that contains a native project (which includes your code and our WikitudeSDK.framework), and the project generated by Unity (which has the UnityFramework.framework).
You should always be working in that workspace, and within that, the main target in your native project should include the WikitudeSDK.framework and UnityFramework.framework under General / Frameworks, Libraries, and Embedded Content. Make sure that they are both set to Embed & Sign.
That distinction you are making between "library" and "plugin" is not really the case. Both the Unity and Wikitude frameworks you are using here are dynamic libraries, you must embed them so they are copied into the final binary. I believe this is what you missed here.
Let us know if that helps.
Hi Damian and thank you for your reply.
I decided to create a fresh demo project for this issue with same versions obviously.
I copied the WikitudeSDK.framework from the Xcode project built by Unity. The path to it was Frameworks/Plugins/iOS/. In the wanted Xcode workspace I copied it under Frameworks in Native Xcode project by drag and dropping the folder using the "create groups" and "copy files if needed" options.
I had to also enable the embed & sign option afterwards.
This clearly made some progress as now I'm getting this error:
2020-08-17 21:08:17.441953+0300 InAppUpdateDemo[1382:1180914] [Storyboard] Unknown class ViewController in Interface Builder file. 2020-08-17 21:08:20.869463+0300 InAppUpdateDemo[1382:1180914] Built from '2019.4/staging' branch, Version '2019.4.5f1 (81610f64359c)', Build type 'Release', Scripting Backend 'il2cpp' -> applicationDidFinishLaunching() 2020-08-17 21:08:20.930102+0300 InAppUpdateDemo[1382:1180914] Metal API Validation Enabled -> applicationWillEnterForeground() -> applicationDidBecomeActive() GfxDevice: creating device client; threaded=1 Initializing Metal device caps: Apple A9 GPU Initialize engine version: 2019.4.5f1 (81610f64359c) UnloadTime: 0.234958 ms URL Resource loaded successfully. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) SampleController:OnFinishLoading() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() Wikitude.<>c__DisplayClass21_0:<TargetCollectionResourceInitialized>b__0() System.Action:Invoke() Wikitude.TrackerManagerQueue:Execute() Wikitude.TrackerManager:ExecuteQueue() Wikitude.WikitudeBridge:InternalUpdate() Wikitude.WikitudeCamera:Update() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Targets loaded successfully. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) SampleController:OnTargetsLoaded() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() Wikitude.ImageTracker:OnTargetsLoadedInternal() Wikitude.<>c:<ImageTrackerFinishedLoading>b__39_0() System.Action:Invoke() Wikitude.TrackerManagerQueue:Execute() Wikitude.TrackerManager:ExecuteQueue() Wikitude.WikitudeBridge:InternalUpdate() Wikitude.WikitudeCamera:Update() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) validateRenderPassDescriptor:757: failed assertion `Texture at colorAttachment has usage (0x01) which doesn't specify MTLTextureUsageRenderTarget (0x04)' (lldb)
For me this seems to be a metal related issue, but I have no idea what is the correct way to fix it without potentially breaking the project further. It's also weird because I tried to run the Xcode project built by Unity before doing this native integration. Running Unity Unity build that way didn't give any errors.
I attached two screenshots that are related to the addition of the WikitudeSDK.framework.
I'll see if I could also submit the example project here.
I added the example projects as a zip to Google Drive and also created a temporary Github repo as a backup solution.https://drive.google.com/file/d/11mCmrKLafuImQVHSsnd6KBXsOECW3CLJ/view?usp=sharing
The issue is still unresolved.
The same issue here. Have you resolved that error?
Setup Xcode correctly and build a Unity Wikitude project that uses native bridge for iOS according to Unity's latest UaaL example:
- Which version of the SDK are you using and are you working with the JS API or the Native API? Wikitude SDK Professional Edition for Unity 9.2
- Are you using any of our Extensions or SDK for Smartglasses (Cordova, Xamarin, Unity)? Unity
- If you work with Unity, what Unity version are you using? 2019.4.5f1
- What device does this happen with (model details and OS version)? Build for iOS 13.6 (iPhone 6S) from Xcode 11.6. MacOs version: 10.15.5
- Is this happening with the sample app or in your own app? If it
happens with your own app, does the sample app work on your device? Own app. There is no sample app available (that I'm aware of) for this use case.
- Send steps to reproduce the issue and include the target images.
This seems to be caused by the fact that Unityframework.framework is a library. Therefore, it's located under the "Products" folder in Xcode. Wikitude instead is tied to that framework on project level and that's why it's a plugin. This relation is broken when the Unityframework library is loaded from a native iOS Xcode project. I don't have too much experience as a iOS developer anyway so all ideas are welcome. I'm hoping for a robust solution that will work for future versions as well so that this issue doesn't repeat.
TLDR: If my assumption of this error is correct then how do I link Wikitude correctly in a Xcode workspace that has both the Unity-iPhone and native single page iOS application Xcode projects?