Skip to content

Commit a0d35e1

Browse files
JSKittyclaude
andcommitted
fix(android): register the ndk context ourselves — tao 0.35 stopped doing it
tao 0.34 registered it during startup; 0.35 dropped that and nothing else in the tauri 2.11 stack does, so every ndk_context consumer (iroh's DNS reader, cpal, netdev, our JNI fallbacks) panicked unconditionally — and a panic escaping the app main is a process abort via tauri's stop_unwind. MainActivity.onCreate now hands the activity to Rust, once per process, restoring the 0.34 semantics; the service-only process stays unregistered as before and keeps failing soft through the guards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0c225ff commit a0d35e1

2 files changed

Lines changed: 313 additions & 248 deletions

File tree

‎src-tauri/gen/android/app/src/main/java/io/vectorapp/MainActivity.kt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ class MainActivity : TauriActivity() {
2828

2929
@JvmStatic
3030
external fun nativeOnResume()
31+
32+
@JvmStatic
33+
external fun nativeRegisterNdkContext(activity: android.app.Activity)
3134
@JvmStatic
3235
external fun nativeOnPause()
3336
@JvmStatic
@@ -128,6 +131,11 @@ class MainActivity : TauriActivity() {
128131
override fun onCreate(savedInstanceState: Bundle?) {
129132
super.onCreate(savedInstanceState)
130133

134+
// Hand Rust the activity for ndk_context (tao 0.35 stopped registering it).
135+
try { nativeRegisterNdkContext(this) } catch (e: Throwable) {
136+
android.util.Log.e("MainActivity", "nativeRegisterNdkContext failed", e)
137+
}
138+
131139
// Ensure hardware acceleration is enabled
132140
window.addFlags(android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED)
133141

0 commit comments

Comments
 (0)