Search Unity

Question Tracked Image Manager makes APK crash

Discussion in 'AR' started by FoxAdventures, Apr 13, 2023.

  1. FoxAdventures

    FoxAdventures

    Joined:
    Jan 31, 2018
    Posts:
    77
    I'm trying to spawn an object on a marker in AR, however when I add the Tracked Image Manager to AR Session Origin, the apk crashes on startup. I even opened the sample scene provided in the AR Template just to make sure it wasn't me. It works fine when Tracked Image Manager is not added as a component. The tracked image is a particle system, but I also tested using a plain cube and the result is still the same. Also tried adding the AR Tracked Image component to the tracked image prefab, but it still crashes whether I have it or not. I'm using AR Core.

    (Specify Size is unchecked in Library because I'm testing in an Android phone)
     

    Attached Files:

  2. thomas_key

    thomas_key

    Unity Technologies

    Joined:
    Dec 14, 2019
    Posts:
    39
    Can you supply both the Unity and ARF version?
     
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
  4. FoxAdventures

    FoxAdventures

    Joined:
    Jan 31, 2018
    Posts:
    77
    I'm not using AR Foundation (assuming that's what ARF stands for) I'm just using the base Unity AR packages: AR package, ARCore XR Plugin, XR Plugin Management. Unity version is 2021.3.16f1
     
  5. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
    Unity does not publish a package called "AR package". The ARCore XR Plug-in is dependent on AR Foundation, so whether you're aware of this or not,
    com.unity.xr.arfoundation
    is imported into your project. You can check the version number in the Package Manager window.
     
    FoxAdventures likes this.
  6. FoxAdventures

    FoxAdventures

    Joined:
    Jan 31, 2018
    Posts:
    77
    Yeah I'm still learning how AR works in Unity, so apologies for that. My ARF version is 4.2.7
     
  7. FoxAdventures

    FoxAdventures

    Joined:
    Jan 31, 2018
    Posts:
    77
    Additionally, the phone works just fine when I'm testing with any other aspect of AR, beit face filters, object placement, plane detection etc. But as soon as I try the tracked image manager, I get an immediate crash.
     
  8. Andrew_Gao1998

    Andrew_Gao1998

    Joined:
    Aug 18, 2022
    Posts:
    1
    OMG, I have almost the same problem with you. What phone are you using?

    I'm using Samsung Galaxy S21Ultra, ARF Version is 4.2.3
     
  9. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
    The most common reason for issues like this is that AR Foundation version and ARCore Plug-in version do not match. Version numbers should always be the same for AR Foundation and related packages.

    If your version numbers are the same though, this sounds like it could be a bug. Please file a report and share your issue number so we can investigate: https://unity3d.com/unity/qa/bug-reporting
     
    makaka-org likes this.
  10. farooqiasfandyar

    farooqiasfandyar

    Joined:
    Apr 19, 2021
    Posts:
    32
    I'm getting the same issue, APK crashes on launch with AR Image Tracker all other features work fine.
    Note: The ARcore Plugin and ARF versions match 4.2.8
     
  11. its_tkc

    its_tkc

    Joined:
    Jul 10, 2020
    Posts:
    1
    same issue AR Core plugin and ARF version is 4.2.8.. happend to me using 2022.3 LTS as well
     
  12. graychane56642

    graychane56642

    Joined:
    Jun 16, 2023
    Posts:
    1
    As a user, it seems like there is an issue with adding the Tracked Image Manager to the AR Session Origin when trying to spawn an object on a marker in AR. The APK crashes on startup when the Tracked Image Manager is included as a component. The issue persists even when using a different type of object or adding the AR Tracked Image component. It's worth mentioning that AR Core is being used and the "Specify Size" option is unchecked in the Library. It might be helpful to consult the AR Core documentation or seek assistance from the developer community for troubleshooting this problem.
     
  13. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    220
  14. dazaizone

    dazaizone

    Joined:
    Mar 6, 2020
    Posts:
    43
    finally, found a thread regarding this, I thought this was an isolated case, it seems a lot of us is encountering this.

    happened to me both 2021.3.16f1 and LTS2022 version
     
  15. cappelnord

    cappelnord

    Joined:
    May 11, 2015
    Posts:
    1
    I am encountering the same crash, LTS 2020.3
     
  16. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
    From our FAQ:

    As mentioned above, please file a bug for this issue.
     
  17. unity_9kX9Z_ZS971IIg

    unity_9kX9Z_ZS971IIg

    Joined:
    Oct 12, 2023
    Posts:
    1
    The same issue, I've sent the bug report.
     
  18. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
    @unity_9kX9Z_ZS971IIg Please share the bug number if you don't mind! It should be of the format IN-XXXXX.
     
  19. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Hi, I just added an Image Tracker to my existing AR app. It works fine on iOS, but crashes on Android if the TrackedImageManger is active in the scene. Unity 2022.3.13f1 using AR Foundation 5.1.1 (all packages up to date). Tested on a Google Pixel 8 Pro.
     
  20. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Where can I find the bug report?
     
  21. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    It seems as if this is the root cause:

    https://issuetracker.unity3d.com/is...is-added-to-the-ar-session-origin-game-object

    Interestingly enough, in our app it is sufficient that the Serialized ReferenceImageLibrary is empty, but assigned to the TrackedImageManager. Causes an immediate crash on app start if the TrackedImageTracker is active in the scene.

    The same happens if the image is not accepted. According to the issue, this happens if the quality score is below 75 (is this documented anywhere?). If I understand the comment in the issue correctly, this should be catched when building. But it doesn't all the time. We're using a custom scripted build.

    I am also wondering what happens if new images are added at runtime?

    Besides: The crash message is unfortunately so uninformative that it took me hours today to investigate. Unity could definitely improve on exceptions thrown by the ARCore subsystem.
     
  22. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,051
    dazaizone and waldgeist like this.
  23. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    388
    Thanks for letting me know!
     
    andyb-unity likes this.