Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Hard crash face tracking on ARCore 1.26.212010383

Discussion in 'AR' started by NNSkelly, Aug 18, 2021.

Thread Status:
Not open for further replies.
  1. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    My team has spent pretty much all of the past 2 days back and forth with a client over an issue that we have fairly conclusively narrowed to specifically ARCore (Google Play Services for AR) 1.26.212010383, which is unfortunately the latest version being pushed by Play Store / autoupdate to a number of newer devices. Long story short, initializing an ARFoundation ARCore session (in our case, with face tracking) immediately hard crashes despite AR availability tests passing. The issue is not present on a device with a slightly older build defaulted from Play Store- 1.26.212010323- or when I sideload the latest apk from the official google github (https://github.com/google-ar/arcore-android-sdk/releases)- 1.26.212010593 as of writing). But when I sideload 383- e.g. unzip it from the xapk at https://apkcombo.com/google-play-se...gle.ar.core/download/phone-1.26.212010383-apk - ARFoundation crashes out with the attached tombstone, backtracing most immediately to a null ref at

    Code (CSharp):
    1. #00 (wrapper managed-to-native) UnityEngine.XR.ARCore.ARCoreSessionSubsystem/NativeApi:UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int,intptr,UnityEngine.XR.ARSubsystems.Feature)
    Kinda hard to bugreport this properly when the failure is specifically on device, specifically with a given 3rd party dependency, and when the project itself is under NDA, but if anyone can get eyeballs on it and see if it repros outside our dev bubble, it would be useful (our client has literally told us to coordinate with Google on their ARCore release schedule to be sure they don't break our app in the future......)

    Anyone else with this, as a stopgap we've spliced a blacklist using techniques from https://forum.unity.com/threads/arf...ck-on-android-does-not-work-correctly.705659/ , most relevantly
    Code (CSharp):
    1. public static bool IsARCoreSupported()
    2.     {
    3. #if UNITY_ANDROID && !UNITY_EDITOR
    4.         var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
    5.         var context = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
    6.         var packageManager = context.Call<AndroidJavaObject>("getPackageManager");
    7.         AndroidJavaObject packageInfo = null;
    8.         long longVersion = 0;
    9.         uint versionCodeMajor = 0, versionCode = 0;
    10.         try
    11.         {
    12.             packageInfo = packageManager.Call<AndroidJavaObject>("getPackageInfo", "com.google.ar.core", 0);
    13.             longVersion = packageInfo.Call<long>("getLongVersionCode");
    14.             versionCodeMajor = (uint)(longVersion >> 32);
    15.             versionCode = (uint)(longVersion & 0xffffffff);
    16.         }
    17.         catch
    18.         {
    19.  
    20.         }
    21.         if (packageInfo != null)
    22.         {
    23.             Debug.Log($"Detected com.google.ar.core long version {longVersion} ({versionCodeMajor} {versionCode})");
    24.             //return true;
    25.             // major check may arbitrarily break things later,
    26.             // but if Google pops a new major version, we probably want to test before claiming compatibility anyway.
    27.             return versionCodeMajor == 0 && versionCode >= 212010323 && versionCode != 212010383; // 383 confirmed busted in isolation
    28.         }
    29.         else
    30.             return false;
    31. #endif
    32.         return false;
    33.     }
    Edit: ARFoundation / ARCore XR Plugin 4.1.7 on Unity 2020.3.8f1
     
    Last edited: Aug 18, 2021
  2. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    tombstone attachment since edit-post is rejecting new files
     

    Attached Files:

  3. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
    I notice in the tombstone_01.txt file that the application is running for armeabi-v7a, which is a 32-bit build.

    ARCore has deprecated support for 32-bit.
    https://developers.google.com/ar/64bit

    Could you try building your application for 64-bit and retesting?
     
  4. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    I'll give it a try next time I'm free to do a build, but it seems odd that a 32 v 64 issue would cause a null ref specifically in 1 version of ARCore sandwiched between 2 working versions.
     
  5. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    ok, looks like IL2CPP 64-bit builds work. The configuration plays havoc with numerous other externals in our project, but for ARFoundation in particular, it restores compatibility with this specific version of ARCore.
     
  6. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    Since ARCore does not support 32-bit builds on 64-bit devices, you're effectively dealing with undefined behavior. A 32-bit build might happen to work in some cases, but in general you should not expect it to.

    Can you share more details about what doesn't work?
     
  7. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    Doing some Amazon AWS integration, and that whole stack looks to have been a bit of a mess lately as the official Unity support has been rolled up into the general .NET support, with most of the original Unity docs re/moved from the github, and all I inherited the project codebase with was a set of Amazon dlls sourced from I couldn't say where. Looks like the Mono compiler works fine, but IL2CPP strips out a bunch of critical logic unless explicitly overridden in a link.xml file. But since the result was just a big barf of ugly red undefined method/value text, it was hard to tell at first whether those libraries were even available/compatible with 64-bit builds.
     
  8. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    22
    Hi all, our app is enabling both armv7 and arm64 in Player Settings
    Our QAs team and customers are reporting many issues with samsung devices with android 11 showing black screen when entering ARFoundation
    For example: S20+ fw 11, S10+ fw 11
    The issue does not occur with Pixel 2 fw 11 or Samsung Devices with android 10 or lower
    We are using AR Foundtion 4.1.7 with Unity 2020.3.16

    Code (CSharp):
    1. 08-27 09:17:49.905: E/DynamiteClient(19046): Failed to load native library [packageName=com.google.ar.core,libraryName=arcore_c] from remote package:
    2. 08-27 09:17:49.905: E/DynamiteClient(19046):
    3. 08-27 09:17:49.905: E/DynamiteClient(19046): java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/~~u_1pv7mhEcdnnbSpbvHKgQ==/com.google.ar.core-ln9aByaqxbuIVWB73BtlpA==/base.apk!/lib/arm64-v8a/libarcore_c.so" is 64-bit instead of 32-bit
    4. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
    5. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
    6. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.System.loadLibrary(System.java:1664)
    it says /base.apk!/lib/arm64-v8a/libarcore_c.so" is 64-bit instead of 32-bit
    How do we fix this issue please?
     
    BitcoinSoul likes this.
  9. xigame

    xigame

    Joined:
    Oct 29, 2022
    Posts:
    1
    Hey there did you just sideloaded zip file from any other third party source like Apkpure or Aptoid like site's?
     
  10. vidinsta

    vidinsta

    Joined:
    Nov 12, 2022
    Posts:
    1
    I think you should download the source directly from the Google Play Store
     
  11. DTsoukalos

    DTsoukalos

    Joined:
    Jul 11, 2019
    Posts:
    8
    @mb13admin did you find any solution to this? I'm getting the same error
     
  12. HaleyLawrence

    HaleyLawrence

    Joined:
    Aug 18, 2023
    Posts:
    1
    Can I ask if I can still get a solution now? I'm doing research on the subject and your reply is very important to me, I'm really sorry for disturbing such an old thread.
     
  13. matteleveny

    matteleveny

    Joined:
    Aug 22, 2023
    Posts:
    1
    I am seeing /base.apk!/lib/arm64-v8a/libarcore_c.so" is 64-bit instead of 32-bit as well. I tried to ask on Reddit but no luck so far... :(
     
  14. solio37

    solio37

    Joined:
    Jan 31, 2024
    Posts:
    1
    you might consider the following steps:

    1. Verify the Issue: Ensure that the issue is indeed related to ARCore version 1.26.212010383 by thorough testing and confirming that the problem persists only with this specific version.

    2. Bug Report: File a bug report with Google, providing detailed information about the crash, including the tombstone and backtrace. Include steps to reproduce the issue and any other relevant information.

    3. Temporary Workaround: As a temporary solution, you might advise affected users to avoid updating to version 1.26.212010383 and stay on the previous version until a fix is provided.

    4. Monitor Official Channels: Keep an eye on official ARCore and ARFoundation channels for any updates or announcements regarding this issue like picasso tv. Google might release a fix in a future update.

    5. Engage with the Community: Participate in forums or discussion groups related to ARCore and ARFoundation to see if other developers are experiencing similar issues. This can provide additional insights and potential workarounds.

    6. Check for Updates: Regularly check for updates from Google regarding ARCore. They may release a newer version that addresses the specific problem you're encountering.
     
  15. mike-copley-unity

    mike-copley-unity

    Unity Technologies

    Joined:
    Dec 7, 2023
    Posts:
    23
    Hey LazuliteJaffer,

    The best thing that we can recommend at this point would be to file a bug:
    https://unity3d.com/unity/qa/bug-reporting
    and provide detailed reproduction steps so that we can ensure that this sample is working properly and hopefully will alleviate your issue.
     
Thread Status:
Not open for further replies.