- Issue category: ARDK
- Device type & OS version: Huawei P30 Pro (Android 12), Samsung Galaxy S20 FE (Android 12), Samsung Galaxy S20 5G (Android 13)
- Host machine & OS version: Windows 11
- Issue Environment: On Device
- Xcode version: n/a
- ARDK version: freshly upgraded from 2.3.0 to 3.4.0-2404081151
- Unity version: 2021.3.3f1, have also tried 2022.3.10f1, 2022.3.16f1
Bug reproduction steps:
Upgrade an existing Unity project in 2021.3.3f1 with ARDK 2.3.0 to ARDK 3.4.0, following the steps outlined in the documentation here: Migration Guide | Niantic Lightship
Description of the issue
I’ve been trying to upgrade an existing project to ARDK3, but Image Tracking isn’t working whenever I have Lightship enabled.
It’s not an issue with my code or image markers; I’ve been testing with a fresh scene with just Unity base components, the Unity sample image library, and a simple debug log script.
No prefab spawns when the camera is pointed at the image marker, and ARTrackedImageManager.trackedImagesChanged can be subscribed to but does not seem to trigger, regardless of how I position the image marker (distance, angle, printed, on screen, etc).
Screen recordings, LogCat messages, and test APK here: ARDK3 Image Tracking issues - Google Drive (APK is just a blank image tracking scene with 1 script for debug logs, using Unity’s test image library. Debug log script is also in that folder under Unity_SetupScreenshots)
Worth noting:
- I have two other projects using the exact same dev environments, also both upgraded from 2.x, in which image tracking is working perfectly. Even when I match the settings to those projects, the issue persists.
- If I uninstall Lightship and use just AR Core, Image Tracking works perfectly in the problem-project.
- I don’t want to uninstall Lightship as we’re using Semantic Segmentation in other scenes (which are working perfectly).
- AR initialises & the AR Foundation debug menu says that Image Tracking is available in this configuration, but trackedImagesChanged never fires from AR Foundation.
- Creating a fresh project to get around the issue is not an option; this is a well established project.
Possibly not related but mentioning just in case it’s relevant:
- We don’t have the SharedAR package installed.
- When I make a change to the XR config (eg disable Semantic Segmentation, which isn’t used in this scene anyway), the apk often crashes on load if I don’t completely delete the previous version of it off my phone first.
- In order to delete this project’s Library I have to use force-delete due to Windows permissions (despite being an Admin account); in other projects I can just move to trash.
Things I’ve tried:
Is one of the other features part of the problem? Maybe! Object detection being enabled seems to prevent AR from initialising at all, but it’s enabled in another project that works just fine
Check Lightship version is the same as our working projects. They’re the same version, as is AR Foundation/ARKit/ARCore
Check Android LogCat for error messages that aren’t showing up in ConsoleLogs. Nothing that looks related to image tracking to me - screenshots in the link above.
Disable custom manifest no difference
Rebuild the library no difference
Use the Android Dependency Resolver no difference
Uninstall and Reinstall Lightship I noticed AR Foundation/ARCore/ARKit were visible in the package manager. I uninstalled them and Lightship, then reinstalled Lightship only. This time around AR Foundation didn’t show up in the Package Manager in 2021.3.3f1 (it does in 2022.3.10/16), though the packages are visible in the Project>Packages files. First test build after the uninstall/reinstall crashed straight after I enabled camera permissions. Rebuilt the library again and the next build didn’t crash but image tracking still didn’t work.
Upgrade to Unity 2022.3.10f1 & 2022.3.16f1 no difference
I’m deeply at a loss on what else to try to resolve this. I understand from the other threads that this is near impossible to repro, so happy trial and error on request (my timezone is Wellington (GMT+12) so I may be async-timing).
Other people having the same/similar issue: