Skip to content

android: keep ONNX Runtime classes so search by meaning stops crashing - #77

Merged
jordan-gibbs merged 1 commit into
mainfrom
fix/android-onnx-keep
Oct 26, 2026
Merged

jordan-gibbs merged 1 commit into
mainfrom
fix/android-onnx-keep

Conversation

@jordan-gibbs

Copy link
Copy Markdown
Contributor

Phones on 1.0.61+79 crash on their first search by meaning once they have vectors from a computer.

Cause. R8 strips ai.onnxruntime.TensorInfo from the release build because only ONNX Runtime's native code uses it, by name over JNI. OrtSession.run then aborts with JNI DETECTED ERROR IN APPLICATION: java_class == null in convertToTensorInfo. Play vitals shows it on a Galaxy S21 Ultra, Android 15, 4 events on 2026-10-21. The 1.0.61 mapping file confirms TensorInfo is missing and OrtUtil was renamed. It hid during testing because the phone only runs the encoder when the vault has vectors, and vectors arrived with desktop 1.0.60.

Fix. Keep the whole ai.onnxruntime package in release builds.

Verify before tagging 1.0.64. Build the release AAB and check build/app/outputs/mapping/release/mapping.txt has ai.onnxruntime.TensorInfo -> ai.onnxruntime.TensorInfo. Not built yet because another session holds Flutter on the build box.

🤖 Generated with Claude Code

R8 removed ai.onnxruntime.TensorInfo from release builds because only
native code uses it, by name, over JNI. The first meaning search on a
phone with vectors aborted the app ("JNI DETECTED ERROR: java_class ==
null" in convertToTensorInfo). Seen in Play vitals on 1.0.61+79,
Galaxy S21 Ultra, Android 15. The 1.0.61 mapping file confirms
TensorInfo is gone and OrtUtil was renamed.

Add a keep rule for the whole ai.onnxruntime package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jordan-gibbs
jordan-gibbs merged commit a336df5 into main Oct 26, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants