Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Android Crash On Local Build Asking Camera Permission With Arcore Xr Plugin Preview 24

Discussion in 'AR' started by unity_Co_fivi4lWiBuA, Apr 12, 2019.

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

    unity_Co_fivi4lWiBuA

    Joined:
    Apr 12, 2019
    Posts:
    3
    Hi, when I ask for camera permissions on Android local build created with gradle it crashes suddenly with a Unity error:

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


    Here is the full log from logcat (adb logcat Unity:* Unity-ARCore:* ArPresto:* *:S):
    I've found a workaround overriding the library unityandroidpermissions.aar inside Library\PackageCache\com.unity.xr.arcore@1.0.0-preview.24\Runtime\Android and using one provided in this link:
    https://github.com/Over17/UnityAndroidPermissions/commit/d31bc86b79a3b6a9b47c85557d62ad4a35af308c
    (full thread here: https://github.com/Over17/UnityAndroidPermissions/issues/17)

    Of course it is only a workaround to allow local builds just for testing, but I shouldn't have to override this library there.

    I'm using Windows with Unity 2018.3.11f1, AR Foundation (1.0.0-preview.22) and ARCore XR Plugin (1.0.0-preview.24). The weird issue is that it doesn't happen with the build done in Cloud build or from a Mac.

    Anyone knows any solution or has had similar issues?
     
    Last edited: Apr 12, 2019
    t-castelo likes this.
  2. t-castelo

    t-castelo

    Joined:
    May 8, 2015
    Posts:
    4
    I had to do the same thing.
     
  3. unity_Co_fivi4lWiBuA

    unity_Co_fivi4lWiBuA

    Joined:
    Apr 12, 2019
    Posts:
    3
    Comparing both classes.dex inside generated apk's (the cloud build one and local one) with APK analyzer, seems like the local apk doesn't include the package com.unity3d.plugin:

    upload_2019-5-3_17-52-19.png

    Any idea behing this weird behaviour?
     
  4. Aidan-Wolf

    Aidan-Wolf

    Joined:
    Jan 6, 2014
    Posts:
    57
    Bump. Getting this too.
     
    aymusbond likes this.
  5. thesanketkale

    thesanketkale

    Joined:
    Dec 14, 2016
    Posts:
    53
    Keyserjaya99 likes this.
  6. simon_unity488

    simon_unity488

    Joined:
    Oct 23, 2019
    Posts:
    8
    Bump because this happened to me as well with Unity 2019.2.9f1 and ARCore Plugin 3.0.1
    The workaround posted by unity_Co_fivi4lWiBuA worked but this shouldn't be happening.
     
  7. ndc_ishizaku

    ndc_ishizaku

    Joined:
    May 11, 2016
    Posts:
    1
    incubestudio and okko-darren like this.
  8. b9n

    b9n

    Joined:
    Feb 6, 2020
    Posts:
    14
    happens with ARCore XR plugin 4.1.0 too
     
    valentin-simian likes this.
  9. aymusbond

    aymusbond

    Joined:
    Dec 8, 2019
    Posts:
    7
    Unity 2019.4 LTS and yet it's happening.
     
  10. JesseAtBlue

    JesseAtBlue

    Joined:
    Jul 28, 2020
    Posts:
    3
    Bump,
    I have this issue using ARCore on 2019.4
     
  11. DeepZhouSmurf01

    DeepZhouSmurf01

    Joined:
    Aug 3, 2020
    Posts:
    1
    I'm using Unity 2020.1.0f1
    Share a solution worked for me:
    Edit -> Project Settings -> Player -> Publishing Settings, then uncheck all Minify settings (Use R8, Release, Debug)
    Hope can help someone~
     
    halinc, t-castelo, Bedov and 4 others like this.
Thread Status:
Not open for further replies.
unityunity