Skip to content

[Bug]: Earn (Money) onboarding crashes ~50% of the time when first opened on Android #31167

@vinnyhoward

Description

@vinnyhoward

Describe the bug

Opening the Earn onboarding screen on Android causes the app to crash approximately 50% of the time, with no user interaction required. Symptom: navigate to the Money/Earn tab, the Rive animation fails to appear, and ~0.2-0.5 seconds later the app aborts via a native SIGABRT. Same rive-react-native library bug as Issue #31166, but triggered during initial mount/render rather than on close.

The screen mounts and the Rive component begins loading, but Android's SurfaceView lifecycle releases the Surface during the navigation transition. The Rive worker thread is mid-frame and calls Surface.unlockCanvasAndPost(), which throws IllegalStateException. Rive's exception handler then calls RiveLogDMakeJStringNewStringUTF without first clearing the pending Java exception, violating ART's JNI rules and aborting the process.

JS-side mitigations attempted (deferring Rive mount via InteractionManager.runAfterInteractions) did not eliminate the crash, suggesting the Surface lifecycle issue is outside the React tree's control

Expected behavior

Opening the Earn onboarding screen should reliably display the Rive animation and allow the user to step through onboarding without crashing.

Screenshots/Recordings

onboarding.mov

Steps to reproduce

  1. Fresh install of the app (or a state where Earn onboarding has not yet been seen) on an arm64 Android device or emulator
  2. Complete primary onboarding through to wallet home
  3. Tap the Money / Earn tab
  4. ~50% of the time: the Rive animation fails to load; app aborts within ~0.2-0.5 seconds
  5. The other ~50%: animation loads normally and the user can interact (but tapping X then crashes, see Issue

Error messages or log output

Abort message: 'JNI DETECTED ERROR IN APPLICATION: JNI NewStringUTF called with pending exception java.lang.Throwable:
java.lang.IllegalStateException: Surface has already been released.
    android.view.Surface.checkNotReleasedLocked(Surface.java:876)
    android.view.Surface.unlockCanvasAndPost(Surface.java:575)
(Throwable with empty stack trace)
    in call to NewStringUTF'

backtrace:
  #00 abort
  #01 art::Runtime::Abort
  #08 art::CheckJNI::NewStringUTF
  #09 rive_android::MakeJString
  #11 rive_android::RiveLogD
  #12 rive_android::DetachThread
  #13 rive_android::JNIExceptionHandler::check_and_rethrow
  #14 rive_android::JNIExceptionHandler::CallVoidMethod
  #15 rive_android::CanvasWorkerImpl::flush
  #16 rive_android::WorkerImpl::doFrame
  #18 rive_android::WorkerThread::threadMain

Where was this bug found?

Internal release testing

Version

7.81.0

Build number

4823

Build type

None

Device

  • Galaxy A32 (Android 13, arm64)
  • Pixel 9 Pro XL emulator (Android, arm64)

Operating system

Android

Additional context

onboarding.txt

Severity

No response

Metadata

Metadata

Assignees

Labels

RCA-neededIssue root cause analysis neededSev1-highAn issue that may have caused fund loss or access to wallet in the past & may still be ongoingregression-RC-7.81.0Regression bug that was found in release candidate (RC) for release 7.81.0release-blockerThis bug is blocking the next releaseta-needs-engineer-escalationTriage-Agent - Applied when confidence is below thresholdta-triagedteam-mobile-platformMobile Platform teamtype-bugSomething isn't working

Type

No fields configured for Bug.

Projects

Status
To be triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions