Android build requires latest AR Services

  • Issue category: Unity Example Package
  • Device type & OS version: Android 11 - OnePlus 7T
  • Host machine & OS version: Windows 10
  • Issue Environment : On Device
  • Xcode version:
  • ARDK version: 1.0.1
  • Unity version: 2021.1/2019 LTS

Description of the issue:
When starting the app (e.g. Mesh scene) I get a popup that says “The application requires the latest version of Google Play Services for AR” and when I click Continue, it opens Google Play with just a close button - I already have Play services for AR (updated 19 Oct).

I tried changing the target API to 29 but now I get a black screen - camera is not detected.

If you need to use Android 11+ / API level 30+ and are getting that Google Play Services AR popup, you might need to add a “queries” section to your AndroidManifest. I’m working on an ARDK doc update that explains all of the steps, but the basic process is:

  1. install gradle v5.6.4 or higher and configure your Unity project to use this version of gradle. Follow the steps at https://developers.google.com/ar/develop/java/enable-arcore for your version of Unity

  2. Add a custom AndroidManifest.xml to your Unity project. You may need to do an initial Android build in Unity, and then copy the generated AndroidManifest.xml in your project’s Temp/gradleOut/unityLibrary/src/main/ to your project’s Assets/Plugins/Android directory. More details on how Unity builds generate the Android manifest are available here: https://docs.unity3d.com/Manual/android-manifest.html.

  3. Edit the custom AndroidManifest.xml and add a <queries> <package android:name="com.google.ar.core" /> </queries> section. Something like:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools">
  <application>

    ...various activity, intent, meta-data tags...

  </application>

  ...various uses-feature and uses-permission tags...

  <queries>
    <package android:name="com.google.ar.core" />
  </queries>    
</manifest>

The black screen with API 29 is likely a different issue. If there’s a log display in the scene you’re building, I’d check that for any sort of warnings.

1 Like

So, my setup: Android 11 (OnePlus7T), Unity 2019 LTS, Gradle 6.9.1, JDK 1.8, no ARCore plugins as I get the merger error (is ARCore required?).

If I use a custom AndroidManifest with that queries tag added, I get an error when building:
ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml:11:5-75 Error:
Missing ‘package’ key attribute on element package at AndroidManifest.xml:11:5-75
ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml Error:
Validation failed, exiting

If I use level API 29, background is black and If I don’t use that custom manifest, this is the log:

--------- beginning of main
Info libc SetHeapTaggingLevel: tag level set to 0
Error YourProductNam Unknown bits set in runtime_flags: 0x800000
Error YourProductNam Not starting debugger since process cannot load the jdwp agent.
Debug ApplicationLoaders Returning zygote-cached class loader: /system/framework/android.test.base.jar
Info Perf Connecting to perf service.
Debug NetworkSecurityConfig No Network Security Config specified, using platform default
Debug NetworkSecurityConfig No Network Security Config specified, using platform default
Error Config:Grabber:OnePlusFontConfig Index 0 requested, with a size of 0
Verbose ViewRootImpl The specified message queue synchronization barrier token has not been posted or has already been removed
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-0,0 #7f020003 app:id/unitySurfaceView} viewRate 0 width 0 height 0
Debug OpScreenModeManager create mRatio 1.2
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …ID 0,0-1080,2275} parent width 1080 parent height 2275 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…ID 0,0-1080,2275 #7f020003 app:id/unitySurfaceView} viewRate 1 width 1080 height 2275
Debug OpScreenModeManager setRefreshRate token android.os.BinderProxy@daa6c4e rate 1 mCurrentRate 0 tmpRate:2
Debug OpScreenModeManager updateScenario fullScreen 1
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …I. 0,0-1080,2275} parent width 1080 parent height 2275 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-1080,2275 #7f020003 app:id/unitySurfaceView} viewRate 1 width 1080 height 2275
Debug DecorView onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@7622a80[UnityPlayerActivity]
Debug ViewRootImpl[UnityPlayerActivity] windowFocusChanged hasFocus=true inTouchMode=true
Info Unity MemoryManager: Using ‘Dynamic Heap’ Allocator.
Info Unity SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 8, Memory = 7473mb
Info Unity SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
Info Unity ApplicationInfo com.YourCompany.YourProductName version 1.0.2 build 3b33143e-ccd6-4a4e-8090-d91b27219220
Info Unity Built from ‘2019.4/staging’ branch, Version ‘2019.4.32f1 (f88bf0bee961)’, Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘arm64-v8a’, Stripping ‘Enabled’
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …ID 0,0-1080,2320} parent width 1080 parent height 2320 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…ID 0,0-1080,2320 #7f020003 app:id/unitySurfaceView aid=1073741824} viewRate 1 width 1080 height 2320
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …I. 0,0-1080,2320} parent width 1080 parent height 2320 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-1080,2320 #7f020003 app:id/unitySurfaceView aid=1073741824} viewRate 1 width 1080 height 2320
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …I. 0,0-1080,2320} parent width 1080 parent height 2320 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-1080,2320 #7f020003 app:id/unitySurfaceView aid=1073741824} viewRate 1 width 1080 height 2320
Error libprocessgroup set_timerslack_ns write failed: Operation not permitted
Info chatty uid=10479(com.YourCompany.YourProductName) UnityMain identical 14 lines
Error libprocessgroup set_timerslack_ns write failed: Operation not permitted
Info AdrenoGLES-0 QUALCOMM build : 559e78c, Ib9d997268a
Info AdrenoGLES-0 Build Date : 10/13/20
Info AdrenoGLES-0 OpenGL ES Shader Compiler Version: EV031.32.02.02
Info AdrenoGLES-0 Local Branch : mybrancheb0d76cb-f27a-f1ff-9cdc-1458d0b52ae8
Info AdrenoGLES-0 Remote Branch : quic/gfx-adreno.lnx.1.0.r99-rel
Info AdrenoGLES-0 Remote Branch : NONE
Info AdrenoGLES-0 Reconstruct Branch : NOTHING
Info AdrenoGLES-0 Build Config : S P 10.0.7 AArch64
Info AdrenoGLES-0 Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
Info AdrenoGLES-0 PFP: 0x016ee190, ME: 0x00000000
Debug Unity GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_half_float GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_compressed_ETC1_RGB8_texture GL_AMD_compressed_ATC_texture GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_OES_texture_compression_astc GL_OES_texture_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_read_format_bgra GL_OES_texture_3D GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_QCOM_alpha_test GL_OES_depth24 GL_OES_packed_depth_stencil GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_EXT_sRGB GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_EXT_texture_type_2_10_10_10_REV GL_EXT_texture_sRGB_decode GL_EXT_texture_format_sRGB_override GL_OES_element_index_uint GL_EXT_copy_image GL_EXT_geometry_shader GL_EXT_tessellation_shader GL_OES_texture_stencil8 GL_EXT_shader_io_blocks GL_OES_shader_image_atomic GL_OES_sample_variables GL_EXT_texture_b
Debug Unity order_clamp GL_EXT_EGL_image_external_wrap_modes GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_OES_shader_multisample_interpolation GL_EXT_texture_cube_map_array GL_EXT_draw_buffers_indexed GL_EXT_gpu_shader5 GL_EXT_robustness GL_EXT_texture_buffer GL_EXT_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_OES_texture_storage_multisample_2d_array GL_OES_sample_shading GL_OES_get_program_binary GL_EXT_debug_label GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_QCOM_tiled_rendering GL_ANDROID_extension_pack_es31a GL_EXT_primitive_bounding_box GL_OES_standard_derivatives GL_OES_vertex_array_object GL_EXT_disjoint_timer_query GL_KHR_debug GL_EXT_YUV_target GL_EXT_sRGB_write_control GL_EXT_texture_norm16 GL_EXT_discard_framebuffer GL_OES_surfaceless_context GL_OVR_multiview GL_OVR_multiview2 GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_EXT_debug_marker GL_OES_EGL_image_external_essl3 GL_OVR_multiview_multisampled_render_to_texture GL_E
Debug Unity XT_buffer_storage GL_EXT_external_buffer GL_EXT_blit_framebuffer_params GL_EXT_clip_cull_distance GL_EXT_protected_textures GL_EXT_shader_non_constant_global_initializers GL_QCOM_texture_foveated GL_QCOM_texture_foveated_subsampled_layout GL_QCOM_shader_framebuffer_fetch_noncoherent GL_QCOM_shader_framebuffer_fetch_rate GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_EGL_image_array GL_NV_shader_noperspective_interpolation GL_KHR_robust_buffer_access_behavior GL_EXT_EGL_image_storage GL_EXT_blend_func_extended GL_EXT_clip_control GL_OES_texture_view GL_EXT_fragment_invocation_density GL_QCOM_motion_estimation GL_QCOM_validate_shader_binary GL_QCOM_YUV_texture_gather
Debug YourProductNam PlayerBase::PlayerBase()
Debug YourProductNam TrackPlayerBase::TrackPlayerBase()
Info libOpenSLES Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
Debug AudioTrack set(): streamType 3, sampleRate 48000, format 0x1, channelMask 0x3, frameCount 0, flags #104, notificationFrames -10, sessionId 9905, transferType 0, uid -1, pid -1
Warn AudioTrack set(): notificationFrames=-10 clamped to the range -1 to -8
Info AudioTrack ull 2 ll!
Debug AudioTrack createTrack_l(0): AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 0 → 1924
Debug AudioTrack ClientUid 10479 AudioTrack::start
Debug CompatibilityChangeReporter Compat change id reported: 150939131; UID 10479; state: DISABLED
Verbose MediaRouter Selecting route: RouteInfo{ name=Phone, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …I. 0,0-1080,2320} parent width 1080 parent height 2320 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-1080,2320 #7f020003 app:id/unitySurfaceView aid=1073741824} viewRate 1 width 1080 height 2320
Debug OpScreenModeManager setRefreshRate parent com.unity3d.player.UnityPlayer{9b5eb03 V.E… …I. 0,0-1080,2320} parent width 1080 parent height 2320 mRatio 1.2
Debug OpScreenModeManager setRefreshRate view android.view.SurfaceView{f241fb2 VFE… .F…I. 0,0-1080,2320 #7f020003 app:id/unitySurfaceView aid=1073741824} viewRate 1 width 1080 height 2320
Info Sphinx Invoking jni callback.
Info Sphinx JVM Loaded.
Debug JVMInterop::getEnv attached previously unattached thread to the JVM
--------- beginning of system
Debug Choreographer initialValue myPid:8734 myTid:11937 choreographer:android.view.Choreographer@f3c790d
Info third_party/arcore/ar/core/android/sdk/session_create.cc Entering ArSession_create
Info third_party/arcore/ar/core/android/sdk/session_create.cc ARCore Version: SDK build name: 1.14
Info third_party/arcore/ar/core/android/sdk/session_create.cc ARCore Version: APK version code: 212840283
Warn YourProductNam Insufficient pre-allocated space to mmap vdex.
Info third_party/arcore/ar/core/android/sdk/session_create.cc Dynamite load ok.
Info third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc Attempting to load native library arcore_c from package com.google.ar.core
Info third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc Dynamite::LoadNativeRemoteLibrary handle=1485804100858365531
Info native I1120 10:35:56.416028 11856 session_create_implementation.cc:244] Entering createImplementationWithFeaturesAndSettings. ARCore SDK version: [1.14.191106000].
Info native I1120 10:35:56.431865 11856 session_create_implementation.cc:208] AugmentedRegion downsample mode from Phenotype: true
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc JniHelper: attached thread (Called from line 364).
Info native I1120 10:35:56.442596 11856 session_create_implementation_shared.cc:2014] min_apk_version_code is: 191106000, phenotype flag of enable_dual_camera_support is: false, phenotype flag of unified_data_source_status is: 2, phenotype flag of unified_shared_cameras_status is: 2, is_dual_camera_supported based on device profile is: false
Info native I1120 10:35:56.442660 11856 session_create_implementation_shared.cc:2027] Settings.camera_stack_option is not specified
Info native I1120 10:35:56.442670 11856 session_create_implementation_shared.cc:2068] Datasource will be created with camera_stack_option = kNdk
Info native I1120 10:35:56.442733 11856 session_create_implementation_shared.cc:2203] Persistent online recalibration is enabled by Phenotype.
Info tflite Initialized TensorFlow Lite runtime.
Error libc Access denied finding property “ro.hardware.chipname”
Info tflite Created TensorFlow Lite XNNPACK delegate for CPU.
Info tflite Replacing 2 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 1 partitions.
Info native I1120 10:35:56.445426 11856 online_calibration_manager.cc:91] OnlineCalibrationManager: Could not open /data/user/0/com.YourCompany.YourProductName/cache/arcore-online-recalibration for reading.
Warn ARCore-ContextUtils The API key for use with the Google AR service could not be obtained!
Info native I1120 10:35:56.464930 11856 session_create_implementation_shared.cc:966] Datasource will be created with timeout = 4s, should_wait = false, should_use_greedy_recovery = true
Info native I1120 10:35:56.464990 11856 android_camera.cc:168] Camera start operation timeout set to 4000 ms.
Info native I1120 10:35:56.465038 11856 android_camera.cc:1826] Initializing camera manager.
Info native I1120 10:35:56.472566 11856 android_camera.cc:1852] Camera manager initialized successfully with 2 cameras.
Info native I1120 10:35:56.472942 11856 imagereader_ndk_wrapper.cc:46] Loading Android NDK 26 symbols from libmediandk.so
Info native I1120 10:35:56.473290 11856 imagereader_ndk_wrapper.cc:69] Successfully loaded Android NDK 26 libmediandk.so symbols.
Info native I1120 10:35:56.473316 11856 cameras.cc:122] Number of hardware buffers is 16. sdk_version=30, is_hardware_buffer_supported=true
Info native I1120 10:35:56.473943 11856 android_sensors.cc:134] Using uncalibrated accelerometer.
Info native I1120 10:35:56.474093 11856 android_sensors.cc:173] Uncalibrated magnetometer available.
Info native I1120 10:35:56.474415 11856 android_sensors.cc:177] Calibrated magnetometer available.
Info native I1120 10:35:56.474849 11856 android_sensors.cc:190] Using SENSOR_TYPE_LIGHT
Info native I1120 10:35:56.474937 11856 android_sensors.cc:193] Could not find SENSOR_TYPE_PRESSURE
Info native I1120 10:35:56.475042 11856 android_sensors.cc:190] Using SENSOR_TYPE_PROXIMITY
Info native I1120 10:35:56.475212 11856 android_sensors.cc:190] Using SENSOR_TYPE_GRAVITY
Info native I1120 10:35:56.475354 11856 android_sensors.cc:190] Using SENSOR_TYPE_ROTATION_VECTOR
Info native I1120 10:35:56.475430 11856 android_sensors.cc:190] Using SENSOR_TYPE_GAME_ROTATION_VECTOR
Info native I1120 10:35:56.475516 11856 android_sensors.cc:190] Using SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
Info native I1120 10:35:56.475574 11856 android_sensors.cc:190] Using SENSOR_TYPE_STEP_DETECTOR
Info native I1120 10:35:56.477766 11856 android_camera.cc:762] [Camera=1; State=CLOSED] Reset cleanly got to CLOSED state.
Info native I1120 10:35:56.477957 11856 android_camera.cc:762] [Camera=0; State=CLOSED] Reset cleanly got to CLOSED state.
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc ~JniHelper: about to detach thread (Called from line 364).
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc ~JniHelper: detached thread (Called from line 364).
Error native E1120 10:35:56.478733 11856 error_policy_util.cc:263]
Error native ################ ARCore Native Error ##################
Error native BUILD_CHANGELIST:404071120
Error native BUILD_BASELINE_CHANGELIST:402190231
Error native ################### Stack Trace Begin ################
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:438
Error native ################### Stack Trace End #################
Error native
Error native ################### Undecorated Trace Begin #################
Error native PERMISSION_DENIED:
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native [type.googleapis.com/util.ErrorSpacePayload=‘ArStatusErrorSpace::AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED’]
Error native === Source Location Trace: ===
Error native third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native
Error native ################### Undecorated Trace End #################
Error native
Info third_party/arcore/ar/core/android/sdk/session_create.cc Entering ArSession_create
Info third_party/arcore/ar/core/android/sdk/session_create.cc ARCore Version: SDK build name: 1.14
Info third_party/arcore/ar/core/android/sdk/session_create.cc ARCore Version: APK version code: 212840283
Info third_party/arcore/ar/core/android/sdk/session_create.cc Dynamite load ok.
Info native I1120 10:35:56.493053 11856 session_create_implementation.cc:244] Entering createImplementationWithFeaturesAndSettings. ARCore SDK version: [1.14.191106000].
Info native I1120 10:35:56.497590 11856 session_create_implementation.cc:208] AugmentedRegion downsample mode from Phenotype: true
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc JniHelper: attached thread (Called from line 364).
Info native I1120 10:35:56.505206 11856 session_create_implementation_shared.cc:2014] min_apk_version_code is: 191106000, phenotype flag of enable_dual_camera_support is: false, phenotype flag of unified_data_source_status is: 2, phenotype flag of unified_shared_cameras_status is: 2, is_dual_camera_supported based on device profile is: false
Info native I1120 10:35:56.505275 11856 session_create_implementation_shared.cc:2027] Settings.camera_stack_option is not specified
Info native I1120 10:35:56.505285 11856 session_create_implementation_shared.cc:2068] Datasource will be created with camera_stack_option = kNdk
Info native I1120 10:35:56.505341 11856 session_create_implementation_shared.cc:2203] Persistent online recalibration is enabled by Phenotype.
Info tflite Replacing 2 node(s) with delegate (TfLiteXNNPackDelegate) node, yielding 1 partitions.
Info native I1120 10:35:56.506426 11856 online_calibration_manager.cc:91] OnlineCalibrationManager: Could not open /data/user/0/com.YourCompany.YourProductName/cache/arcore-online-recalibration for reading.
Warn ARCore-ContextUtils The API key for use with the Google AR service could not be obtained!
Info native I1120 10:35:56.510961 11856 session_create_implementation_shared.cc:966] Datasource will be created with timeout = 4s, should_wait = false, should_use_greedy_recovery = true
Info native I1120 10:35:56.511024 11856 android_camera.cc:168] Camera start operation timeout set to 4000 ms.
Info native I1120 10:35:56.511040 11856 android_camera.cc:1826] Initializing camera manager.
Info native I1120 10:35:56.515842 11856 android_camera.cc:1852] Camera manager initialized successfully with 2 cameras.
Info native I1120 10:35:56.515916 11856 cameras.cc:122] Number of hardware buffers is 16. sdk_version=30, is_hardware_buffer_supported=true
Info native I1120 10:35:56.516469 11856 android_sensors.cc:134] Using uncalibrated accelerometer.
Info native I1120 10:35:56.516885 11856 android_sensors.cc:173] Uncalibrated magnetometer available.
Info native I1120 10:35:56.516969 11856 android_sensors.cc:177] Calibrated magnetometer available.
Info native I1120 10:35:56.517020 11856 android_sensors.cc:190] Using SENSOR_TYPE_LIGHT
Info native I1120 10:35:56.517200 11856 android_sensors.cc:193] Could not find SENSOR_TYPE_PRESSURE
Info native I1120 10:35:56.517287 11856 android_sensors.cc:190] Using SENSOR_TYPE_PROXIMITY
Info native I1120 10:35:56.517406 11856 android_sensors.cc:190] Using SENSOR_TYPE_GRAVITY
Info native I1120 10:35:56.517473 11856 android_sensors.cc:190] Using SENSOR_TYPE_ROTATION_VECTOR
Info native I1120 10:35:56.517529 11856 android_sensors.cc:190] Using SENSOR_TYPE_GAME_ROTATION_VECTOR
Info native I1120 10:35:56.517579 11856 android_sensors.cc:190] Using SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR
Info native I1120 10:35:56.517688 11856 android_sensors.cc:190] Using SENSOR_TYPE_STEP_DETECTOR
Info native I1120 10:35:56.518885 11856 android_camera.cc:762] [Camera=1; State=CLOSED] Reset cleanly got to CLOSED state.
Info native I1120 10:35:56.519155 11856 android_camera.cc:762] [Camera=0; State=CLOSED] Reset cleanly got to CLOSED state.
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc ~JniHelper: about to detach thread (Called from line 364).
Verbose third_party/redwood/infrastructure/jni_common/jni_helper.cc ~JniHelper: detached thread (Called from line 364).
Error native E1120 10:35:56.519886 11856 error_policy_util.cc:263]
Error native ################ ARCore Native Error ##################
Error native BUILD_CHANGELIST:404071120
Error native BUILD_BASELINE_CHANGELIST:402190231
Error native ################### Stack Trace Begin ################
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:438
Error native ################### Stack Trace End #################
Error native
Error native ################### Undecorated Trace Begin #################
Error native PERMISSION_DENIED:
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native
Error native ARCoreError: third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native [type.googleapis.com/util.ErrorSpacePayload=‘ArStatusErrorSpace::AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED’]
Error native === Source Location Trace: ===
Error native third_party/arcore/ar/core/android/implementation/android_platform_checks.cc:92
Error native third_party/arcore/ar/core/android/implementation/session_create_implementation_shared.cc:2604
Error native third_party/arcore/ar/core/android/implementation/session_create_implementation.cc:376
Error native
Error native ################### Undecorated Trace End #################
Error native
Debug vulkan searching for layers in ‘/data/app/~~OGUjbgUTGo1FoCWy6EbV4w==/com.YourCompany.YourProductName-ts795ul1AlHHCxSs1vSkAA==/lib/arm64’
Debug vulkan searching for layers in ‘/data/app/~~OGUjbgUTGo1FoCWy6EbV4w==/com.YourCompany.YourProductName-ts795ul1AlHHCxSs1vSkAA==/base.apk!/lib/arm64-v8a’
Info AdrenoVK-0 ===== BEGIN DUMP OF OVERRIDDEN SETTINGS =====
Info AdrenoVK-0 ===== END DUMP OF OVERRIDDEN SETTINGS =====
Info AdrenoVK-0 QUALCOMM build : 559e78c, Ib9d997268a
Info AdrenoVK-0 Build Date : 10/13/20
Info AdrenoVK-0 Shader Compiler Version : EV031.32.02.02
Info AdrenoVK-0 Local Branch : mybrancheb0d76cb-f27a-f1ff-9cdc-1458d0b52ae8
Info AdrenoVK-0 Remote Branch : quic/gfx-adreno.lnx.1.0.r99-rel
Info AdrenoVK-0 Remote Branch : NONE
Info AdrenoVK-0 Reconstruct Branch : NOTHING
Info AdrenoVK-0 Build Config : S P 10.0.7 AArch64
Info AdrenoVK-0 Driver Path : /vendor/lib64/hw/vulkan.adreno.so
Info InfiniTAM Vulkan Compute Support Found: Adreno ™ 640
Error native E1120 10:35:57.132371 11856 config_c_api.cc:271] operator(): session was passed NULL.
Error native E1120 10:35:57.132483 11856 config_c_api.cc:258] operator(): session was passed NULL.
Error native E1120 10:35:57.132495 11856 config_c_api.cc:348] operator(): session was passed NULL.
Error native E1120 10:35:57.132504 11856 config_c_api.cc:518] operator(): session was passed NULL.
Error native E1120 10:35:57.132512 11856 config_augmented_image_c_api.cc:19] operator(): session was passed NULL.
Error native E1120 10:35:57.132520 11856 config_c_api.cc:478] operator(): session was passed NULL.
Error native E1120 10:35:57.132530 11856 config_c_api.cc:377] operator(): session was passed NULL.
Error native E1120 10:35:57.132537 11856 session_lite_c_api.cc:104] operator(): session was passed NULL.
Info Unity Loaded: Unlit/ARCoreFrame
Info Unity Niantic.ARDK.Rendering._ARCoreFrameRenderer:.ctor(RenderTarget, Resolution, Single, Single, Shader)
Info Unity Niantic.ARDK.Rendering.ARFrameRendererFactory:Create(RenderTarget, Resolution, RuntimeEnvironment, Single, Single)
Info Unity Niantic.ARDK.Helpers.ARRenderingManager:CreateRenderer(RuntimeEnvironment)
Info Unity Niantic.ARDK.Helpers.ARRenderingManager:OnSessionRan(ARSessionRanArgs)
Info Unity Niantic.ARDK.Utilities.ArdkEventHandler`1:Invoke(TArgs)
Info Unity Niantic.ARDK.AR._NativeARSession:Run(IARConfiguration, ARSessionRunOptions)
Info Unity System.Action:Invoke()
Info Unity Niantic.ARDK.Utilities._CallbackQueue:_ConsumeQueue()
Info Unity
Info Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
Info Unity
Error native E1120 10:35:57.138552 11905 session_c_api.cc:220] operator(): session was passed NULL.
Error native E1120 10:35:57.138639 11905 session_lite_c_api.cc:45] operator(): session was passed NULL.
Error native E1120 10:35:57.154199 11905 session_c_api.cc:220] operator(): session was passed NULL.
Error native E1120 10:35:57.154281 11905 session_lite_c_api.cc:45] operator(): session was passed NULL.
Error native E1120 10:35:57.181596 11905 session_c_api.cc:220] operator(): session was passed NULL.
Error native E1120 10:35:57.181673 11905 session_lite_c_api.cc:45] operator(): session was passed NULL.
Error native E1120 10:35:57.213666 11905 session_c_api.cc:220] operator(): session was passed NULL.

For the AndroidManifest issue, are you sure that your Unity is configured to use your v6.9.1 gradle? By default my Unity was using an older gradle that came bundled with Unity android build support, so I had to change this in Preferences->External Tools:

For the API 29 log, the only thing that jumps out at me is the camera permission issue. If you’re building any of the awareness scenes in ARDK-examples, they should have an AndroidPermissionRequestor script component with a Camera element. Maybe check your device’s app permissions, or try deleting the build off your device, rebuilding and redeploying, and see if you get the camera permission pop-up?

Hi! Do you have any update on the above, have you managed to sort it out? I am facing the same issues, I d be interested in this ARDK doc when s ready

Hi Giulia. I updated the android build doc page, adding a section at the bottom of this page for building for Android 11+

https://lightship.dev/docs/building_android.html

This process worked for me on a test Pixel 4a device running Android 11. There were a lot of steps, however, so please feel free to post here if it doesn’t work for you.

No, I gave up. Will try in a later release…

Hi @Dan_Yu, following the steps solved all the issues, thanks a lot for it!

1 Like

I just wanted to add that I struggled with making a build - ran into a lot of Gradle issues. I finally got it to work by making a AAB instead of an APK build.

1 Like

Hi Eusebiu,

For the black screen issue that you are experiencing on Android, do you see the Vulkan Graphics API listed in your Project Settings > Player > Other Settings > Graphics APIs? If so, you should remove this, as it can often lead to a black screen being displayed on some Android devices.

Also, as Dan_Yu pointed out in a previous post, there might be a camera permission on device that’s not being allowed at runtime. As far as I know, the example apps don’t always prompt for camera permissions when you run them on device, so you might want to try checking the permissions for the app after it’s installed to make sure that they are all enabled.

Hope this helps!

Settings:


JDK: C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08
NDK: r19c
Gradle: C:\Tools\gradle-6.9.1
=> all these with permissions result in black screen

If I use API 30 / Android 11 with a custom manifes, I get gradle errors (both aab and apk).

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    xmlns:tools="schemas.android.com/tools">
    <application>
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:theme="@style/UnityThemeSelector">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        </activity>
    </application>  
    <queries>
    <package android:name="com.google.ar.core" />
  </queries> 
</manifest>

ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml:18:5-75 Error:

    Missing 'package' key attribute on element package at AndroidManifest.xml:18:5-75

ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml Error:

    Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':unityLibrary:processReleaseManifest'.

> Manifest merger failed with multiple errors, see logs

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at help.gradle.org

BUILD FAILED in 9s

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

CommandInvokationFailure: Gradle build failed.

C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08\bin\java.exe -classpath "C:\Tools\gradle-6.9.1\lib\gradle-launcher-6.9.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

stderr[

ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml:18:5-75 Error:

    Missing 'package' key attribute on element package at AndroidManifest.xml:18:5-75

ARDKStarted\Temp\gradleOut\unityLibrary\src\main\AndroidManifest.xml Error:

    Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':unityLibrary:processReleaseManifest'.

> Manifest merger failed with multiple errors, see logs

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at help.gradle.org

BUILD FAILED in 9s

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

]

stdout[

Starting a Gradle Daemon, 2 incompatible and 2 stopped Daemons could not be reused, use --status for details

> Configure project :launcher

WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported.

The current default is 'true'.

> Configure project :unityLibrary

WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported.

The current default is 'true'.

> Task :launcher:preBuild UP-TO-DATE

> Task :unityLibrary:preBuild UP-TO-DATE

> Task :unityLibrary:preReleaseBuild UP-TO-DATE

> Task :unityLibrary:checkReleaseManifest

> Task :launcher:prepareLintJar

> Task :unityLibrary:processReleaseManifest FAILED

See g.co/androidstudio/manifest-merger for more information about the manifest merger.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

Use '--warning-mode all' to show the individual deprecation warnings.


3 actionable tasks: 3 executed

]

exit code: 1
2 Likes

Apparently, some anti-span system has hidden my post with the settings and logs… :frowning:

Thanks for the heads up, we’ve fixed the post and are looking at the information that you’ve added.

1 Like

This is how I got mine to work also, by setting the target build for Android 10 when running on an Android 11.

I imagine something is out of sync between the most recent Android release which was only 3 months ago, and whatever is testing for the presence of the most updated Google Play Services for AR.

4 Likes

Got mine working by setting the target API level to Android 10.0 as well. My Gradle version was kept to the recommended one and I did not add in the custom AndroidManifest file. Hope this works for others facing the same problem too

1 Like

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.