Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug ARFoundation black screen issue on Android 11

Discussion in 'AR' started by mb13admin, Aug 27, 2021.

  1. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    18
    Hi all,
    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

    Before it was fine but after we try to build with Target SDK 30 (as Google requirement for submission) the black screen occurs on fw 11

    We are using AR Foundtion 4.1.7 with Unity 2020.3.16
    Can anyone help us on this?
    Cheers
     
    BitcoinSoul likes this.
  2. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    18
    Today we are reported crashes with ARCore on samsung flagships while they are trying to load the arcore plugin

    Code (CSharp):
    1. 08-27 09:17:49.844: I/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): Entering ArSession_createWithFeatures
    2. 08-27 09:17:49.844: I/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): ARCore Version: SDK build name: 1.22
    3. 08-27 09:17:49.845: I/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): ARCore Version: APK version code: 212010383
    4. 08-27 09:17:49.865: D/InputTransport(1120): Input channel destroyed: 'ClientS', fd=735
    5. 08-27 09:17:49.866: I/Zygote(775): Process 12755 exited due to signal 9 (Killed)
    6. 08-27 09:17:49.867: I/libprocessgroup(1120): Successfully killed process cgroup uid 10092 pid 12755 in 50ms
    7. 08-27 09:17:49.872: W/ActivityManager(1120): setHasOverlayUi called on unknown pid: 12755
    8. 08-27 09:17:49.873: I/SemDvfsHyPerManager(13607): acquire hyper - com.samsung.android.game.gos/13607@6, type = 536875010
    9. 08-27 09:17:49.875: I/CameraService(1129): UidPolicy: No processes running for a uid=10092 disabled=0
    10. 08-27 09:17:49.876: I/HYPER-HAL(870): [RequestManager.cpp]acquire(): Acquired ID : 92663697  [13607 / 6]    HINT :      list : [GPUMaxFreq / 345]
    11. 08-27 09:17:49.903: I/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): Dynamite load ok.
    12. 08-27 09:17:49.903: I/third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc(19046): Attempting to load native library arcore_c from package com.google.ar.core
    13. 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:
    14. 08-27 09:17:49.905: E/DynamiteClient(19046):  
    15. 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
    16. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
    17. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
    18. 08-27 09:17:49.905: E/DynamiteClient(19046):     at java.lang.System.loadLibrary(System.java:1664)
    19. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.google.vr.dynamite.NativeLibraryLoader.b(PG:5)
    20. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.google.vr.dynamite.NativeLibraryLoader.initializeAndLoadNativeLibrary(PG:2)
    21. 08-27 09:17:49.905: E/DynamiteClient(19046):     at gan.A(PG:6)
    22. 08-27 09:17:49.905: E/DynamiteClient(19046):     at agy.onTransact(PG:3)
    23. 08-27 09:17:49.905: E/DynamiteClient(19046):     at android.os.Binder.transact(Binder.java:1079)
    24. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.google.a.a.a.b(BaseProxy.java:2)
    25. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.google.vr.dynamite.client.b.initializeAndLoadNativeLibrary(INativeLibraryLoader.java:3)
    26. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.google.vr.dynamite.client.DynamiteClient.loadNativeRemoteLibrary(DynamiteClient.java:8)
    27. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    28. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
    29. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
    30. 08-27 09:17:49.905: E/DynamiteClient(19046):     at android.os.Handler.dispatchMessage(Handler.java:102)
    31. 08-27 09:17:49.905: E/DynamiteClient(19046):     at android.os.Looper.loop(Looper.java:246)
    32. 08-27 09:17:49.905: E/DynamiteClient(19046):     at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
    33. 08-27 09:17:49.905: I/third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc(19046): Dynamite::LoadNativeRemoteLibrary handle=0
    34. 08-27 09:17:49.905: E/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): Dynamite failed to load remote library
    35. 08-27 09:17:49.905: E/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): LoadSymbolsDynamite returning AR_ERROR_FATAL.
    36. 08-27 09:17:49.905: E/third_party/arcore/ar/core/android/sdk/session_create.cc(19046): LoadSymbols returning status.
    37. 08-27 09:17:49.905: E/native(19046): session_manager.cc:56 ArPresto::ArCore session creation failed.
     
    BitcoinSoul likes this.
  3. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    324
    The key message in your crash report is:
    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" [URL='http://www.google.com/search?q=is+msdn.microsoft.com']is[/URL] 64-bit instead of 32-bit


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

    See this thread for more discussion on our forum.
    https://forum.unity.com/threads/hard-crash-face-tracking-on-arcore-1-26-212010383.1158317/
     
    fuzzy3d likes this.
  4. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    18
    Hi, Did you mean to turn of armv7 and keep only arm64?
    We are enabling both ARMv7 and ARM64 in Player Settings
    and I'm wondering why do those flagships choose to run armv7 apk instead of arm64 instead?
     
  5. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    324
    For devices that are 64-bit only or devices that support both 64- and 32-bit, the 64-bit version of the app should be used.

    There are some devices that support ARCore but that are still only 32-bit. Only these devices should use the 32-bit version of the app.

    If you are building for both armv7 and arm64, that is the correct approach. You will need to file a bug with Unity for us to be able to investigate the issue.
    https://unity3d.com/unity/qa/bug-reporting
     
  6. mb13admin

    mb13admin

    Joined:
    May 28, 2017
    Posts:
    18
    Yes we are using both armv7 and arm64 for 2 years and it has been working fine when we use unity 2019.4 and ARfoundation 3

    Since when upgrade to unity 2020.3 and ARFoundation 4.1.7 recently,
    the issue only occurs on Samsung S series with andoird 11 only (S10, S20, S21 and variants)
    it does not occur on Samsung Note, A or Tab series or other manufactrurers like Pixel and Xiaomi
    I believe this is a bug on how Unity/ARFoundation handle the so file foreach platform
     
  7. flankechen

    flankechen

    Joined:
    Aug 20, 2015
    Posts:
    1
    @mb13admin
    hi, we might have facing the same problem. I am on ARFoundation 4.1.1, ARCore 4.1.1 unity 2019.4.29. while armv7+arm64 build fails in some devices, only armv7 build works fine.
    error log looks the same as yours:

    Code (CSharp):
    1. E/DynamiteClient: Failed to load native library [packageName=com.google.ar.core,libraryName=arcore_c] from remote package:
    2.          
    3.         java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.google.ar.core-Sci-ciX5Ty7u1I-SDVNtRg==/base.apk!/lib/arm64-v8a/libarcore_c.so" is 64-bit instead of 32-bit
    4.             at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
    5.             at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
    6.             at java.lang.System.loadLibrary(System.java:1667)
    7.             at com.google.vr.dynamite.NativeLibraryLoader.b(PG:5)
    8.             at com.google.vr.dynamite.NativeLibraryLoader.initializeAndLoadNativeLibrary(PG:2)
    9.             at faf.A(PG:6)
    10.             at adl.onTransact(PG:3)
    11.             at android.os.Binder.transact(Binder.java:914)
    12.             at com.google.a.a.a.a(BaseProxy.java:4)
    13.             at com.google.vr.dynamite.client.b.initializeAndLoadNativeLibrary(INativeLibraryLoader.java:9)
    14.             at com.google.vr.dynamite.client.DynamiteClient.loadNativeRemoteLibrary(DynamiteClient.java:35)
    15.             at com.google.ar.core.Session.nativeCreateSessionAndWrapperWithFeatures(Native Method)
    16.             at com.google.ar.core.Session.<init>(Session.java:11)
    17.             at com.google.ar.core.Session.<init>(Session.java:4)
    18.             at com.stxr.xrengine.XREngineActivity.isARCoreRun(XREngineActivity.java:187)
    19.             at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    20.             at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
    21.             at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
    22.             at android.os.Handler.dispatchMessage(Handler.java:103)
    23.             at android.os.Looper.loop(Looper.java:237)
    this happen only on some devices like:
    Sumsung Galaxy Zflip(SM-F711N)
    Sumsung Galaxy S10(SC-03L) Android 10
    SonyXperia 5Ⅱ(XQ-AS42) Android 11

    I think it's something wrong with arfoundation accidentally trying to load 32bit .so even 64bit .so exist. Did you find a solution of this? Thanks
     
  8. MattJackB

    MattJackB

    Joined:
    Oct 14, 2018
    Posts:
    29
    https://forum.unity.com/threads/arcore-causes-black-screen-and-crash.1276409/

    Having similar issues here^ and have tried countless fixes including:
    - Removing ARMv7 and only keeping ARM64
    - Updated to the latest version of ARFoundation (4.1.10)
    - Lowered the target API to Android 11 (down from from 32)
    - Turned off the 'Update AR' option (which tries to update the users Google Play Services for AR)
    - Enabled multithreaded rendering
    - Disabled R8 minify
    - Reset the player settings and re-filled them
    - AR session component is disabled until the device passes a check that confirms if the device is AR compatible
    - Went from Unity 2020.3.19f1 to 2020.3.34f1
    - Downgraded to ARFoundation 4.0.12
    - Changed Tracking mode to 'Don't Care' from 'Position and Rotation'
    My issue is that when trying to open the AR feature/ scene, the app freezes, shows a black screen, then crashes. This has been the case on Samsung and Google devices.

    EDIT:
    Manged to solve the issue on that thread; hope it's helpful to everyone else!
     
    Last edited: May 24, 2022
  9. unity_HHEcGUR7CMJGoQ

    unity_HHEcGUR7CMJGoQ

    Joined:
    Tuesday
    Posts:
    1
    having same problem. app runs fine in standard pipeline. but when i switch to URP, app freezes. I do have AR background feature added in render pipeline settings.
     
unityunity