Search Unity

Resolved Error due to UnityAndroidPermissions

Discussion in 'AR' started by cgeye, May 26, 2021.

  1. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    76
    Hi,

    My AR app freezes on my Android device when it attempts to load an AR session. Running Logcat Reveals an issue with Android permissions that I can't work out. Can anybody help me with this?

    Snippet from the log here:

    AndroidJavaException: java.lang.ClassNotFoundException: com.unity3d.plugin.UnityAndroidPermissions

    05-26 12:10:14.814 7409 7458 E Unity : java.lang.ClassNotFoundException: com.unity3d.plugin.UnityAndroidPermissions

    05-26 12:10:14.814 7409 7458 E Unity : at java.lang.Class.classForName(Native Method)

    05-26 12:10:14.814 7409 7458 E Unity : at java.lang.Class.forName(Class.java:453)

    05-26 12:10:14.814 7409 7458 E Unity : at com.unity3d.player.UnityPlayer.nativeRender(Native Method)

    05-26 12:10:14.814 7409 7458 E Unity : at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)

    05-26 12:10:14.814 7409 7458 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)

    05-26 12:10:14.814 7409 7458 E Unity : at android.os.Handler.dispatchMessage(Handler.java:102)

    05-26 12:10:14.814 7409 7458 E Unity : at android.os.Looper.loop(Looper.java:214)

    05-26 12:10:14.814 7409 7458 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)

    05-26 12:10:14.814 7409 7458 E Unity : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.plugin.UnityAndroidPermissions" on path: DexPathList[[zip file
     
  2. cgeye

    cgeye

    Joined:
    Mar 5, 2014
    Posts:
    76



    In case anybody else has this issue, I solved it by moving the UnityAndroidPermissions.aar plugin from ARCore/runtime/Android to plugins/android/lib folder
     
  3. Arunmurali17

    Arunmurali17

    Joined:
    Apr 4, 2022
    Posts:
    1
    Im faceing same issue how to solve it pls help me .i'm new
     
  4. acruz0426

    acruz0426

    Joined:
    Nov 18, 2022
    Posts:
    2
    Unfortunately I'm still facing the same problem. The above solution doesn't seem to work for me. I'm currently using 2021.3.14f1.
     
  5. P4radigm

    P4radigm

    Joined:
    Mar 26, 2019
    Posts:
    1
    Just for anyone in the future searching for this. For me turning off the Minify 'Release' option under the Publishing Settings in Player settings solved the issue. Also resulted in negligible build size difference in my case, but that might differ per case I guess.

    Edit: Alright spoke too soon, you got to enable this option for unity to generate the ReTrace mapping file, which is needed to publish on the play store. I found this thread that has a workaround that worked for me, while also keeping the Minify option enabled: https://forum.unity.com/threads/minify-release-option-breaks-ar.1332969/
     
    Last edited: Apr 29, 2023