Skip to content

Commit 2c5ded6

Browse files
v2.57.3 (#344)
* fix: drop libvrapi.so and deprecate OVR to fix Android 16KB launch crash (#491) * fix: sample real LiDAR depthConfidence from ARKit confidenceMap on iOS * Front-camera AR: use a registered provider instead of ARFaceTrackingConfiguration * chore: update changelog * fix: add missing files for camera provider * fix: Crash on background/foreground transition with ViroVideo * fix: ViroVideo teardown/lifecycle deadlocks on Android * fix: anchor DepthPoint hit-test results without native ARHitTestResult (iOS) * docs: changelog for ViroVideo #478 and DepthPoint anchor fixes --------- Co-authored-by: Ernesto Mendoza <emhgerencia@gmail.com>
1 parent 97ae5d8 commit 2c5ded6

19 files changed

Lines changed: 303 additions & 120 deletions

File tree

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# CHANGELOG
22

3+
## v2.57.3 — 2 July 2026
4+
5+
### Changed
6+
7+
- **Front-camera AR no longer references the ARKit face-tracking / TrueDepth API in core (iOS).** `VROARSessioniOS` previously instantiated `ARFaceTrackingConfiguration` directly whenever `frontCameraEnabled` was set — so the TrueDepth symbol was compiled into every ViroKit binary and Apple's static App Store scan (Guideline 2.5.1) flagged *all* apps, even rear-camera-only ones that never touch the front camera. The front-camera path now consults a process-wide configuration provider (`VROARSessioniOS::setFrontCameraConfigProvider`) and runs whatever `ARConfiguration` it returns via `-runWithConfiguration:` (config was already stored/run as the base class, so nothing downstream changed); when no provider is registered it falls through to world tracking. A new Objective-C registration host, `VROFrontCameraProvider`, forwards to that setter and is discovered at runtime via `NSClassFromString` by the optional [`@reactvision/react-viro-face-tracking`](https://www.npmjs.com/package/@reactvision/react-viro-face-tracking) package, which is now the *only* place that references `ARFaceTrackingConfiguration`. Result: the core ViroKit binary is free of the TrueDepth API, and only apps that opt into front-camera face tracking carry (and declare) it.
8+
9+
### Fixed
10+
11+
- **ViroVideo Android lifecycle crash & ANR fixed (viro#478).** (1) `AVPlayer` guards its ExoPlayer listener callbacks with a `mDestroyed` flag set before release, so callbacks arriving after the native `VROAVPlayer` is deleted no longer reach freed memory (the background/foreground crash). (2) The GL render thread no longer blocks on the main thread calling ExoPlayer: `getCurrentTimeInSeconds()`/`getVideoDurationInSeconds()` read a main-thread-refreshed `volatile` cache, and `play()`/`pause()` are fire-and-forget — removing a deadlock against `GLSurfaceView.surfaceDestroyed()` that froze/ANR'd the app when leaving a ViroVideo screen (also per-frame playback jank). `nativeDeleteVideoTexture` no longer pauses on the GL thread before delete, and `destroy()` posts `ExoPlayer.release()` off the teardown call.
12+
- **AR hit-test results derived from depth data can now be anchored (iOS).** `createAnchoredNodeAtHitLocation()` returned null when a hit result had no underlying `ARHitTestResult` — e.g. a depth-synthesized `DepthPoint` — so `createAnchoredNode` failed with "hit result type does not support anchors". It now builds the `ARAnchor` from the result's own world transform in that case.
13+
- **iOS LiDAR `depthConfidence` now reports real confidence instead of the depth value.** In AR hit-test results the LiDAR confidence was sampled with `sampleDepthTextureAtUV()`, which always reads `ARFrame.sceneDepth.depthMap` regardless of the texture passed — so `depthConfidence` returned the depth (in metres) rather than a confidence. A dedicated `sampleConfidenceAtUV()` now reads ARKit's `sceneDepth.confidenceMap` (`ARConfidenceLevel`) and normalises it to `[0,1]` (low=0.0, medium=0.5, high=1.0; `-1.0` when unavailable). The existing LiDAR confidence gate (`> 0.3`) now works as intended, discarding low-confidence depth hits. The monocular path was unaffected.
14+
- **Android 15+ 16 KB launch crash — removed the non-compliant `libvrapi.so` (viro#491).** v2.57.2 aligned every `PT_LOAD` segment to ≥ 16 KB, but the prebuilt `libvrapi.so` (Meta VrApi / Oculus Mobile SDK) still had a `PT_GNU_RELRO` segment ending at `0x19000` — a 4 KB boundary, not a 16 KB one — leaving ~680 bytes of non-RELRO data sharing the tail page. Android 15+ rejects this (`program alignment (4096) cannot be smaller than system page size (16384)`; APK Analyzer: "RELRO is not a suffix and its end is not 16 KB aligned"). A field-level `p_align` patch on a stripped prebuilt cannot re-pad RELRO — only a real relink can — and `libviro_renderer.so` listed `libvrapi.so` as `NEEDED`, so it was force-loaded on **every** launch, crashing all apps (AR / GVR / Quest) on 16 KB-page devices.
15+
16+
### Removed
17+
18+
- **Deprecated and removed the Oculus Mobile SDK (VrApi) renderer path.** `VROSceneRendererOVR` / `VROInputControllerOVR` are no longer compiled, `lib-ovr` is unlinked, and `libvrapi.so` is dropped from `jniLibs` (both ABIs), so `libviro_renderer.so` no longer depends on it. VrApi targets EOL hardware (GearVR / Oculus Go); all current Meta headsets use the OpenXR path (`VROSceneRendererOpenXR`, added in 2.55.0–2.57.1). `nativeCreateRendererOVR` now returns 0 and `ViroViewOVR` is `@Deprecated`.
19+
20+
---
21+
322
## v2.57.2 — 29 June 2026
423

524
### Fixed

ViroRenderer/capi/VideoTexture_JNI.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ VRO_METHOD(void, nativeAttachDelegate)(VRO_ARGS
105105

106106
VRO_METHOD(void, nativeDeleteVideoTexture)(VRO_ARGS
107107
VRO_REF(VROVideoTexture) textureRef) {
108-
std::shared_ptr<VROVideoTexture> videoTexture = VRO_REF_GET(VROVideoTexture, textureRef);
109-
videoTexture->pause();
108+
// Do NOT pause() here. This can run on the GL/render thread during scene teardown,
109+
// and pause() bounces to the main thread (ExoPlayer must be touched there) — which is
110+
// simultaneously blocked in GLSurfaceView.surfaceDestroyed() waiting for this GL thread,
111+
// deadlocking (ANR on exit). Deleting the texture already tears the player down:
112+
// ~VROVideoTextureAVP -> delete _player -> ~VROAVPlayer -> AVPlayer.destroy() (stop+release).
110113
VRO_REF_DELETE(VROVideoTexture, textureRef);
111114
}
112115

android/sharedCode/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ add_library( # Sets the name of the library.
5454
${VIRO_ANDROID_SRC}/VROLooper.cpp
5555
${VIRO_ANDROID_SRC}/VROSceneRenderer.cpp
5656
${VIRO_ANDROID_SRC}/VROSceneRendererGVR.cpp
57-
${VIRO_ANDROID_SRC}/VROSceneRendererOVR.cpp
57+
# VROSceneRendererOVR.cpp (VrApi / GearVR-Oculus Go) deprecated in 2.57.3 —
58+
# superseded by the OpenXR (Quest) path. Excluding it drops the libvrapi.so
59+
# dependency, which was not 16 KB-page compliant (see viro#491).
5860
${VIRO_ANDROID_SRC}/VROSceneRendererOpenXR.cpp
5961
${VIRO_ANDROID_SRC}/VROARSessionOpenXR.cpp
6062
${VIRO_ANDROID_SRC}/VROSceneRendererSceneView.cpp
@@ -68,7 +70,7 @@ add_library( # Sets the name of the library.
6870
${VIRO_ANDROID_SRC}/VROTypefaceAndroid.cpp
6971
${VIRO_ANDROID_SRC}/VROInputControllerDaydream.cpp
7072
${VIRO_ANDROID_SRC}/VROInputControllerCardboard.cpp
71-
${VIRO_ANDROID_SRC}/VROInputControllerOVR.cpp
73+
# VROInputControllerOVR.cpp deprecated in 2.57.3 (VrApi path removed).
7274
${VIRO_ANDROID_SRC}/VROInputControllerOpenXR.cpp
7375
${VIRO_ANDROID_SRC}/VROAVRecorderAndroid.cpp
7476
${VIRO_ANDROID_SRC}/VROTextureReader.cpp
@@ -399,12 +401,11 @@ set_target_properties( lib-gvr-audio
399401
PROPERTIES IMPORTED_LOCATION
400402
${VIRO_ANDROID_LIBS}/${ANDROID_ABI}/libgvr_audio.so )
401403

402-
add_library( lib-ovr
403-
SHARED
404-
IMPORTED )
405-
set_target_properties( lib-ovr
406-
PROPERTIES IMPORTED_LOCATION
407-
${VIRO_ANDROID_LIBS}/${ANDROID_ABI}/libvrapi.so )
404+
# lib-ovr (libvrapi.so — Meta VrApi / Oculus Mobile SDK) removed in 2.57.3.
405+
# VrApi targets EOL hardware (GearVR / Oculus Go); all current Meta headsets use
406+
# the OpenXR path (libopenxr_loader.so). The prebuilt libvrapi.so was not 16 KB
407+
# page-size compliant (PT_GNU_RELRO not 16 KB-aligned) and crashed Android 15+
408+
# 16 KB devices on launch because libviro_renderer.so listed it as NEEDED (viro#491).
408409

409410
add_library( lib-freetype
410411
SHARED
@@ -509,7 +510,6 @@ target_link_libraries( # Specifies the target library.
509510
atomic
510511
lib-gvr
511512
lib-gvr-audio
512-
lib-ovr
513513
lib-freetype
514514
lib-protobuf
515515
lib-BulletCollision

android/sharedCode/src/main/cpp/jni/VRORenderer_JNI.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "vr/gvr/capi/include/gvr_audio.h"
3434
#include "VROProjector.h"
3535
#include "VROSceneRendererGVR.h"
36-
#include "VROSceneRendererOVR.h"
36+
// VROSceneRendererOVR.h (VrApi) removed in 2.57.3 — see nativeCreateRendererOVR below.
3737
#include "VROSceneRendererOpenXR.h"
3838
#include "VROSceneRendererSceneView.h"
3939
#include "VROPlatformUtil.h"
@@ -102,21 +102,13 @@ VRO_METHOD(jlong, nativeCreateRendererOVR)(VRO_ARGS
102102
jboolean enableHDR,
103103
jboolean enablePBR,
104104
jboolean enableBloom) {
105-
VROPlatformSetType(VROPlatformType::AndroidOVR);
106-
107-
std::shared_ptr<gvr::AudioApi> gvrAudio = std::make_shared<gvr::AudioApi>();
108-
gvrAudio->Init(env, android_context, class_loader, GVR_AUDIO_RENDERING_BINAURAL_HIGH_QUALITY);
109-
VROPlatformSetEnv(env, android_context, asset_mgr, platform_util);
110-
111-
VRORendererConfiguration config;
112-
config.enableShadows = enableShadows;
113-
config.enableHDR = enableHDR;
114-
config.enablePBR = enablePBR;
115-
config.enableBloom = enableBloom;
116-
117-
std::shared_ptr<VROSceneRenderer> renderer
118-
= std::make_shared<VROSceneRendererOVR>(config, gvrAudio, view, activity, env);
119-
return Renderer::jptr(renderer);
105+
// Deprecated in 2.57.3. The VrApi (Oculus Mobile SDK / GearVR / Oculus Go)
106+
// renderer was removed together with libvrapi.so, which was not 16 KB
107+
// page-size compliant and crashed Android 15+ 16 KB devices (viro#491).
108+
// All supported Meta headsets use the OpenXR path (nativeCreateRendererOpenXR).
109+
// Returns 0 so the Java layer degrades gracefully instead of loading VrApi.
110+
pinfo("ViroViewOVR / OVR_MOBILE is deprecated (removed in 2.57.3) — use the QUEST (OpenXR) platform instead");
111+
return 0;
120112
}
121113

122114
VRO_METHOD(jlong, nativeCreateRendererOpenXR)(VRO_ARGS
@@ -453,12 +445,14 @@ VRO_METHOD(void, nativeSetDebugHUDEnabled)(VRO_ARGS
453445
renderer->getRenderer()->setDebugHUDEnabled(enabled);
454446
}
455447

456-
// This function is OVR only!
448+
// VR-only (OpenXR / Quest). The legacy OVR (VrApi) path was removed in 2.57.3.
457449
VRO_METHOD(void, nativeRecenterTracking)(VRO_ARGS
458450
jlong native_renderer) {
459451
std::shared_ptr<VROSceneRenderer> renderer = Renderer::native(native_renderer);
460-
std::shared_ptr<VROSceneRendererOVR> ovrRenderer = std::dynamic_pointer_cast<VROSceneRendererOVR>(renderer);
461-
ovrRenderer->recenterTracking();
452+
std::shared_ptr<VROSceneRendererOpenXR> xrRenderer = std::dynamic_pointer_cast<VROSceneRendererOpenXR>(renderer);
453+
if (xrRenderer) {
454+
xrRenderer->recenterTracking();
455+
}
462456
}
463457

464458
VRO_METHOD(VRO_FLOAT_ARRAY, nativeProjectPoint)(VRO_ARGS

android/sharedCode/src/main/java/com/viro/core/Renderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public void drawFrame() {
9696
}
9797
public void setVRModeEnabled(boolean enabled) { nativeSetVRModeEnabled(mNativeRef, enabled); }
9898

99-
/* ---------- OVR only methods ---------- */
99+
/* ---------- OVR only methods (deprecated 2.57.3 — VrApi removed, see viro#491) ---------- */
100+
@Deprecated
100101
public Renderer(ClassLoader appClassLoader, Context context,
101102
ViroViewOVR view, Activity activity, AssetManager assets, PlatformUtil platformUtil,
102103
RendererConfiguration config) {

android/sharedCode/src/main/java/com/viro/core/VideoTexture.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,19 @@ public void dispose() {
190190
*/
191191
public void play() {
192192
mPaused = false;
193-
nativePlay(mNativeRef);
193+
if (mNativeRef != 0) {
194+
nativePlay(mNativeRef);
195+
}
194196
}
195197

196198
/**
197199
* Pause the video.
198200
*/
199201
public void pause() {
200202
mPaused = true;
201-
nativePause(mNativeRef);
203+
if (mNativeRef != 0) {
204+
nativePause(mNativeRef);
205+
}
202206
}
203207

204208
/**

android/sharedCode/src/main/java/com/viro/core/ViroViewOVR.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,14 @@
5252
/**
5353
* ViroViewOVR is a {@link ViroView} for rendering content in stereo for VR headsets using
5454
* the Oculus Mobile SDK.
55+
*
56+
* @deprecated Deprecated in 2.57.3. The Oculus Mobile SDK (VrApi) targets EOL hardware
57+
* (GearVR / Oculus Go) and its native library ({@code libvrapi.so}) is not 16 KB page-size
58+
* compliant, crashing Android 15+ 16 KB devices on launch (viro#491). Use {@link ViroViewOpenXR}
59+
* with the {@code QUEST} platform for all current Meta headsets. This class no longer creates a
60+
* native renderer.
5561
*/
62+
@Deprecated
5663
public class ViroViewOVR extends ViroView implements SurfaceHolder.Callback {
5764

5865
static {

0 commit comments

Comments
 (0)