I'm happy to report that Image Tracking is working under the versions listed below. I followed Vuforia's instructions and used the Magic Leap Main Camera (Packages/Magic Leap SDK/Runtime/Tools/Prefabs/Main Camera.prefab
) with the Vuforia Behavior and Error Handler added.
It appears my previous problems were due to the fact I was using too old a version of Unity before (I was using 2022.2.21f1, which didn't work even though it was 2022.2.0f1 or newer <-- I propose this text in the Magic Leap 2 documentation should be revised).
For completeness I'm including the errors/warnings I see in the Unity Console, despite the project running.
Unity Editor version: 2022.3.12f1
ML2 OS version: 1.4.0 dev2
MLSDK version: 1.11.0
Host OS: (Windows/MacOS) MacOS
Error messages from logs (syntax-highlighting is supported via Markdown):
Invalid AssetDatabase path: /Users/patryk/VuforiaImg1/Assets/VuforiaLicense.cs. Use path relative to the project folder.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Vuforia.EditorClasses.LicenseKeyObfuscationTask:Execute ()
BuildObserver/<>c:b__3_0 (Vuforia.EditorClasses.VuforiaLifeCycleTask)
System.Collections.Generic.List1<Vuforia.EditorClasses.VuforiaLifeCycleTask>:ForEach (System.Action
1<Vuforia.EditorClasses.VuforiaLifeCycleTask>)
BuildObserver:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
Vulkan support is currently experimental in Vuforia Engine and therefore not fully supported.
UnityEngine.Debug:LogWarningFormat (string,object)
Vuforia.Internal.Utility.UnityLogger:LogWarning (string,object)
Vuforia.Internal.Utility.Log:Warning (string,object)
Vuforia.EditorClasses.PlayerSettingsValidationResultExtensions:DoLog (System.Action2<string, object[]>,string,object[]) Vuforia.EditorClasses.PlayerSettingsValidationResultExtensions:Warn (string) Vuforia.EditorClasses.PlayerSettingsValidationResultExtensions:LogHighSeverity (Vuforia.EditorClasses.PlayerSettingsValidationResult) PlayerSettingsValidationTask:Execute () BuildObserver/<>c:<OnPreprocessBuild>b__3_0 (Vuforia.EditorClasses.VuforiaLifeCycleTask) System.Collections.Generic.List
1<Vuforia.EditorClasses.VuforiaLifeCycleTask>:ForEach (System.Action`1<Vuforia.EditorClasses.VuforiaLifeCycleTask>)
BuildObserver:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Multiple ADB server instances found, the following ADB server instance have been terminated due to being run from another SDK. Process paths:
/Applications/ML Hub.app/Contents/Eclipse/plugins/com.magicleap.adb.macosx.x86_64_1.0.41.28_0_2_202304071616/adb/adb
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Android manifest path = /Users/patryk/VuforiaImg1/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/AndroidManifest.xml
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Multiple ADB server instances found, the following ADB server instance have been terminated due to being run from another SDK. Process paths:
/Applications/ML Hub.app/Contents/Eclipse/plugins/com.magicleap.adb.macosx.x86_64_1.0.41.28_0_2_202304071616/adb/adb
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Application installed to device "G862XT000021 [Magic Leap 2]".
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Build completed with a result of 'Succeeded' in 21 seconds (21091 ms)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildPlayerWindow.cs:189)
Saving has no effect. Your class 'UnityEditor.XR.Simulation.XREnvironmentViewManager' is missing the FilePathAttribute. Use this attribute to specify where to save your ScriptableSingleton.
Only call Save() and use this attribute if you want your state to survive between sessions of Unity.
UnityEditor.XR.Simulation.XREnvironmentViewManager:OnDisable () (at ./Library/PackageCache/com.unity.xr.arfoundation@5.1.0/Editor/Simulation/XREnvironmentViewManager.cs:169)