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.
  2. Dismiss Notice

Question AR Camera not opening Native Android Project

Discussion in 'AR' started by Pravitha, Jun 9, 2023.

  1. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    AR Camera working fine in unity project but after integrating native android AR Camera not opening. And after Export project AndroidManifest.xml not generated.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    What do you mean with integrating native android ar camera?
     
  3. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    In unity project, using AR Foundation is working good. But after exporting, to integrate into Native android application, AR camera is not working and not asking for permission as well. Also black screen will be displayed in the mobile.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Do you mean an android build?
    If so, enable debug build and autoconnect profiler and you can see errors in the unity console (or logcat)
     
  5. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    Yeah will check the error's below are the error's shown in the logcat. Kindly help me out this issue.

    DllNotFoundException: Unable to load DLL 'UnityARCore'. Tried the load the following dynamic libraries: Unable to load dynamic library 'UnityARCore' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "UnityARCore" not found
    at UnityEngine.XR.ARCore.ARCoreSessionSubsystem+NativeApi.UnityARCore_session_construct (UnityEngine.XR.ARCore.ARCoreSessionSubsystem+NativeApi+CameraPermissionRequestProviderDelegate cameraPermissionRequestProvider) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.XR.ARCore.ARCoreSessionSubsystem+ARCoreProvider..ctor () [0x00000] in <00000000000000000000000000000000>:0

    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    No ARSession available for the current platform. Please ensure you have installed the relevant XR Plug-in package for this platform via XR Plug-in Management (Project Settings > XR Plug-in Management).

    No active UnityEngine.XR.ARSubsystems.XRPlaneSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    Failed to load native plugin: Unable to load library '/data/app/~~3IlTu0Rg-Vwcdo19GI4c2g==/com.rpgf.amble-JwUSzikSEUBrlfhlRitKoQ==/lib/arm64/libUnityARCore.so', error 'java.lang.UnsatisfiedLinkError: dlopen failed: library "libarcore_sdk_c.so" not found: needed by /data/app/~~3IlTu0Rg-Vwcdo19GI4c2g==/com.rpgf.amble-JwUSzikSEUBrlfhlRitKoQ==/lib/arm64/libUnityARCore.so in namespace classloader-namespace'
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    1. Go to XR management, android tab and enable initialize XR on startup and check ARCore.
    2. Does your phone support ARCore and does it have AR services installed?
     
    andyb-unity likes this.
  7. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    Yes you mentioned two things i'm done already. Now show this error .

    ARCore-ArCoreApk: Error while checking app details and ARCore status
    com.google.ar.core.exceptions.FatalException: Application manifest must contain activity com.google.ar.core.InstallActivity
    at com.google.ar.core.k.j(ArCoreApkImpl.java:14)
    at com.google.ar.core.k.d(ArCoreApkImpl.java:1)
    at com.google.ar.core.k.checkAvailability(ArCoreApkImpl.java:2)
    at com.google.ar.core.ArCoreApkJniAdapter.checkAvailability(ArCoreApkJniAdapter.java:1)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.access$500(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:126)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:210)
    at android.os.Looper.loop(Looper.java:299)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Is your target API set to highest installer?
    Do you use sdk/ndk/jdk installed via unity hub?
    Do you use a custom manifest in publish settings?
     
  9. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    yes target API is highest version 33 for the app gradle
    30 for the unitylibrary gradle. Yes sdk,ndk,jdk used via unity hub.
    yes custom manifest.
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Set it to highest installed and make sure you use the latest unity version you can. Then api 33 is supported.

    And why do you use a custom manifest? Try without it and all the other custom stuff.
    Get it working FIRST, if that doesn't work ask for help, if that's fixed add stuff. Don't try to add stuff and only then ask for help
     
  11. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    Using unity version -> 2021.3.26f1
    target version -> 31
    I Uncheck the custom manifest
    then i try to that way again it will come same issue
    help me out this issue.

    ARCore-ArCoreApk: Error while checking app details and ARCore status
    com.google.ar.core.exceptions.FatalException: Application manifest must contain activity com.google.ar.core.InstallActivity
    at com.google.ar.core.k.j(ArCoreApkImpl.java:14)
    at com.google.ar.core.k.d(ArCoreApkImpl.java:1)
    at com.google.ar.core.k.checkAvailability(ArCoreApkImpl.java:2)
    at com.google.ar.core.ArCoreApkJniAdapter.checkAvailability(ArCoreApkJniAdapter.java:1)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.access$500(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:126)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loopOnce(Looper.java:210)
    at android.os.Looper.loop(Looper.java:299)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    I'd say just start a new project, check if the build works
    Then enable arcore, check if the build works
    Then add parts of your project or compare settings untill it breaks
     
  13. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    While exporting manifest file is not generating for me. In this case if I run with native am facing an error Manifest file missing.
    So can I manually add the manifest file? Or if you can share me reference links which specifies the manifest regarding while exporting.
     
  14. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    It should be automatically generated. I see the error, but your project is too big for me to help
     
  15. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    upload_2023-6-13_18-30-47.png

    So how to downgrade the XR plugin version, can you please help me.
     
  16. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    This does not break it. I've been using it for a while without any issue. There have been update since the change as well.
    Start with a blank project and work from there to see what breaks it
     
  17. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    Hi, I am creating a new project to check whether the manifest file gets auto-generated wihtout enabling the AR foundation. After that while installing AR foundation manifest files is not generated by default. So I have added the manifest file manually.

    And from newly created project, added CUBE as a 3D object and exported to native android application. In this case am facing below error.

    Application manifest must contain meta-data com.google.ar.core.min_apk_version -> So added below and error got resolved.
    <meta-data
    android:name="com.google.ar.core.min_apk_version"
    android:value="24" />
    After adding above meta, application getting below error

    Application manifest must contain activity com.google.ar.core.InstallActivity
    How can we solve this error?
     
  18. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Where are you looking that you can say it does not generate the manifest?
    This is a temporary file, so is visible when you extract the apk probably
     
  19. Pravitha

    Pravitha

    Joined:
    Mar 24, 2023
    Posts:
    12
    upload_2023-6-15_20-29-31.png

    This location manifest get generated, after AR foundation installed in unity export to this android application not generated.
     
  20. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    774
    Not sure I'm following everything going on in this thread, but here are some tips.

    If your project contains XR Plug-in Management 4.3.1, there is a known bug with Android manifest in that version. More info here: https://forum.unity.com/threads/in-...tes-unitylibrary-androidmanifest-xml.1432444/

    I would recommend that you try building our samples project as a baseline, which is not known to have any issues: https://github.com/Unity-Technologies/arfoundation-samples

    If you are unable to determine the cause of your issue and you believe it's a bug in Unity, please file a bug: https://unity3d.com/unity/qa/bug-reporting