fix: about page version unknown and link crash on Android (#213) #224

Merged
guettlibot merged 5 commits from issue-213-fix into main 2026-05-24 15:20:15 +00:00
guettlibot commented 2026-05-24 15:15:52 +00:00 (Migrated from codeberg.org)

Summary

Fixes two bugs reported in issue #213 that affect Play Store builds on some Android devices.

Bug 1 – "App Version: unknown"

PackageInfo.fromPlatform() returns "unknown" because the package_info_plus plugin never registered. Root cause: GeneratedPluginRegistrant.java wraps each plugin registration in catch (Exception e). If a plugin registered before package_info_plus throws a Java Error (e.g. NoClassDefFoundError — not an Exception subclass), the catch is bypassed, the exception propagates out of registerWith(), and all subsequent plugin registrations are skipped.

Fix: Change all 13 catch (Exception e) clauses to catch (Throwable e) in GeneratedPluginRegistrant.java, and un-gitignore the file so the patched version is committed and picked up by release CI builds (Dagger overlays git-tracked android/ source after flutter pub get).

Bug 2 – App crash when tapping sharedinbox.de link

url_launcher_android 6.3.25 migrated to Pigeon 26, which throws a PlatformException(channel-error, ...) on some Android devices — the exact same root cause as path_provider_android 2.2.21 that was already pinned in this repo. The onTapLink callback in AboutScreen called launchUrl via unawaited() with no error handling, so the PlatformException became an unhandled async error and crashed the app.

Fix:

  1. Pin url_launcher_android: ">=6.3.0 <6.3.25" in dependency_overrides (same pattern as the existing path_provider_android pin).
  2. Extract a _launchUrl() helper with try/catch that shows an error SnackBar instead of crashing. Also applies to the "Create issue" button.

Test plan

  • New widget test AboutScreen link tap with failed url_launcher shows error snackbar verifies that a PlatformException from url_launcher shows an error SnackBar (not a crash).
  • All 5 about_screen widget tests pass.
  • All 123 widget tests pass (flutter test test/widget/).
  • All 329 unit tests pass (flutter test test/unit/).
  • flutter analyze — no issues.
  • Pre-commit hooks pass (dart format, hygiene checks).

🤖 Generated with Claude Code

## Summary Fixes two bugs reported in issue #213 that affect Play Store builds on some Android devices. ### Bug 1 – "App Version: unknown" `PackageInfo.fromPlatform()` returns "unknown" because the `package_info_plus` plugin never registered. Root cause: `GeneratedPluginRegistrant.java` wraps each plugin registration in `catch (Exception e)`. If a plugin registered before `package_info_plus` throws a Java **`Error`** (e.g. `NoClassDefFoundError` — not an `Exception` subclass), the catch is bypassed, the exception propagates out of `registerWith()`, and all subsequent plugin registrations are skipped. **Fix:** Change all 13 `catch (Exception e)` clauses to `catch (Throwable e)` in `GeneratedPluginRegistrant.java`, and un-gitignore the file so the patched version is committed and picked up by release CI builds (Dagger overlays git-tracked `android/` source after `flutter pub get`). ### Bug 2 – App crash when tapping sharedinbox.de link `url_launcher_android 6.3.25` migrated to Pigeon 26, which throws a `PlatformException(channel-error, ...)` on some Android devices — the exact same root cause as `path_provider_android 2.2.21` that was already pinned in this repo. The `onTapLink` callback in `AboutScreen` called `launchUrl` via `unawaited()` with no error handling, so the `PlatformException` became an unhandled async error and crashed the app. **Fix:** 1. Pin `url_launcher_android: ">=6.3.0 <6.3.25"` in `dependency_overrides` (same pattern as the existing `path_provider_android` pin). 2. Extract a `_launchUrl()` helper with `try/catch` that shows an error SnackBar instead of crashing. Also applies to the "Create issue" button. ## Test plan - [ ] New widget test `AboutScreen link tap with failed url_launcher shows error snackbar` verifies that a `PlatformException` from `url_launcher` shows an error SnackBar (not a crash). - [ ] All 5 about_screen widget tests pass. - [ ] All 123 widget tests pass (`flutter test test/widget/`). - [ ] All 329 unit tests pass (`flutter test test/unit/`). - [ ] `flutter analyze` — no issues. - [ ] Pre-commit hooks pass (dart format, hygiene checks). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.