fix(175): OnnxruntimePackage in MainApplication.kt registrieren #247

Merged
admin-mrrm merged 1 commit from fix-175-onnxruntime-mainapp into main 2026-05-13 22:23:49 +02:00
Owner

Summary

  • Eigener Expo-Config-Plugin plugins/with-onnxruntime-package.js patcht MainApplication.kt und fügt OnnxruntimePackage zur PackageList hinzu.
  • Adressiert den Folgefehler nach #244 (Cannot read property 'install' of null).
  • Vitest-Tests gegen Kotlin-Fixture.

Root-Cause

onnxruntime-react-native hat unimodule.json, aber keinen android.modules-Eintrag. Expo-Autolinking erkennt es als Pseudo-Expo-Modul und überspringt es deshalb beim Generieren von PackageList.java. Der upstream app.plugin.js patcht nur build.gradle. Resultat: AAR im APK, ReactPackage nicht registriert, NativeModules.Onnxruntime === null zur Laufzeit.

Test plan

  • pnpm --filter @mrrmlab/mobile exec vitest run plugins grün
  • pnpm --filter @mrrmlab/mobile typecheck grün
  • EAS Dev-Build neu, App startet ohne install of null
  • NLI-Klassifikation greift bei erster Mail
## Summary - Eigener Expo-Config-Plugin `plugins/with-onnxruntime-package.js` patcht `MainApplication.kt` und fügt `OnnxruntimePackage` zur PackageList hinzu. - Adressiert den Folgefehler nach #244 (`Cannot read property 'install' of null`). - Vitest-Tests gegen Kotlin-Fixture. ## Root-Cause `onnxruntime-react-native` hat `unimodule.json`, aber keinen `android.modules`-Eintrag. Expo-Autolinking erkennt es als Pseudo-Expo-Modul und überspringt es deshalb beim Generieren von `PackageList.java`. Der upstream `app.plugin.js` patcht nur `build.gradle`. Resultat: AAR im APK, ReactPackage nicht registriert, `NativeModules.Onnxruntime === null` zur Laufzeit. ## Test plan - [x] `pnpm --filter @mrrmlab/mobile exec vitest run plugins` grün - [x] `pnpm --filter @mrrmlab/mobile typecheck` grün - [ ] EAS Dev-Build neu, App startet ohne `install of null` - [ ] NLI-Klassifikation greift bei erster Mail
fix(175): OnnxruntimePackage in MainApplication.kt registrieren
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
43ad81b959
Root-Cause Gray-Screen-Folgefehler `[TypeError: Cannot read property
'install' of null]` aus `onnxruntime-react-native/lib/binding.ts:14`:

`unimodule.json` im Paket täuscht Expo-Autolinking vor, es handle sich
um ein Expo-Modul — ohne `android.modules`-Eintrag wird in der
generierten `PackageList.java` aber kein Eintrag für
`OnnxruntimePackage` erzeugt. Der upstream-Plugin (`app.plugin.js`)
patcht nur die `build.gradle` (Gradle-Dep), nicht aber
`MainApplication.kt`. Resultat: `.aar` ist im APK, aber kein
ReactPackage registriert → `NativeModules.Onnxruntime === null`.

Lokaler Config-Plugin `plugins/with-onnxruntime-package.js` patcht jetzt
`MainApplication.kt`/`.java` und fügt Import + `packages.add(...)` ein.
Idempotent via `mergeContents`-Tag.

Tests (vitest) gegen Kotlin-Fixture: Import wird gesetzt,
Add-Call landet nach `PackageList(this).packages`,
zweiter Lauf dedupliziert.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
admin-mrrm/mrrmlabapp!247
No description provided.