Environment
- Package:
@reactvision/react-viro
- Platform: Android 14+ (API 34+)
- Architecture: arm64-v8a
- Affected file:
viro_renderer-release.aar → jni/arm64-v8a/libviro_renderer.so
Summary
On Android 14+ (API 34+), the app crashes with a SIGABRT during AR anchor
creation. The crash occurs inside ARUtilsCreateJavaARAnchorFromAnchor at
file offset 0x55E5EC in libviro_renderer.so.
This issue was identified and analyzed with the help of Claude (Anthropic),
which traced the binary-level root cause and proposed both a workaround and a
proper fix.
Root Cause
The native function ARUtilsCreateJavaARAnchorFromAnchor calls
env->NewStringUTF(anchorId) where anchorId is the raw byte string returned
by ARCore for the anchor's identifier.
Starting with Android 14 (API 34), ART's strict JNI enforcement was
significantly tightened. NewStringUTF now aborts the process if the
provided byte string contains any bytes that are not valid
Modified UTF-8.
ARCore anchor IDs are arbitrary opaque byte strings and are not guaranteed to
be valid Modified UTF-8, which triggers this abort.
The resulting crash in logcat looks like:
A/libc: Fatal signal 6 (SIGABRT)
backtrace:
#00 ARUtilsCreateJavaARAnchorFromAnchor + 212
The anchor ID is only used inside Viro's Java layer to populate
ARAnchor.mAnchorId. It is never exposed to the JavaScript layer in typical
usage, so passing null or a sanitized replacement does not affect AR
functionality.
Steps to Reproduce
- Use
@reactvision/react-viro with AR features (e.g. ViroARScene with
anchor tracking)
- Run on a physical device with Android 14+ (API 34+)
- Trigger AR anchor creation (e.g. place an object, detect a surface)
- The app crashes immediately with
SIGABRT
References
Android 14 JNI changes — stricter NewStringUTF validation
JNI Tips — Modified UTF-8
Environment
@reactvision/react-viroviro_renderer-release.aar→jni/arm64-v8a/libviro_renderer.soSummary
On Android 14+ (API 34+), the app crashes with a
SIGABRTduring AR anchorcreation. The crash occurs inside
ARUtilsCreateJavaARAnchorFromAnchoratfile offset
0x55E5ECinlibviro_renderer.so.This issue was identified and analyzed with the help of Claude (Anthropic),
which traced the binary-level root cause and proposed both a workaround and a
proper fix.
Root Cause
The native function
ARUtilsCreateJavaARAnchorFromAnchorcallsenv->NewStringUTF(anchorId)whereanchorIdis the raw byte string returnedby ARCore for the anchor's identifier.
Starting with Android 14 (API 34), ART's strict JNI enforcement was
significantly tightened.
NewStringUTFnow aborts the process if theprovided byte string contains any bytes that are not valid
Modified UTF-8.
ARCore anchor IDs are arbitrary opaque byte strings and are not guaranteed to
be valid Modified UTF-8, which triggers this abort.
The resulting crash in logcat looks like:
The anchor ID is only used inside Viro's Java layer to populate
ARAnchor.mAnchorId. It is never exposed to the JavaScript layer in typicalusage, so passing
nullor a sanitized replacement does not affect ARfunctionality.
Steps to Reproduce
@reactvision/react-virowith AR features (e.g.ViroARScenewithanchor tracking)
SIGABRTReferences
Android 14 JNI changes — stricter NewStringUTF validation
JNI Tips — Modified UTF-8