Skip to content

Fix iOS crash on startup from missing file_handler plugin#163

Closed
bakicelebi wants to merge 1 commit into
Catrobat:developfrom
bakicelebi:fix/ios-file-handler-missing-plugin
Closed

Fix iOS crash on startup from missing file_handler plugin#163
bakicelebi wants to merge 1 commit into
Catrobat:developfrom
bakicelebi:fix/ios-file-handler-missing-plugin

Conversation

@bakicelebi

Copy link
Copy Markdown
Contributor

Summary

  • iOS crashes on startup with MissingPluginException from the org.catrobat.paintroid/file_handler MethodChannel (introduced in [PAINTROID - 776] Second instance of app is opened when catrobat image is opened from files #146). The existing try only catches PlatformException, which is a distinct class — main() crashes before runApp(), leaving a white screen.
  • Adds an explicit on MissingPluginException catch that no-ops. The file_handler channel is implemented on Android only; iOS doesn't support the open-from-Files flow yet.

Reproduction (before this fix)

  1. flutter run -d <ios-simulator> on current develop
  2. App boots to white screen
  3. Console shows: Unhandled Exception: MissingPluginException(No implementation found for method getInitialFile on channel org.catrobat.paintroid/file_handler) originating in lib/main.dart:40

Test plan

  • flutter run on iOS simulator → app reaches Pocket Paint home screen
  • flutter run on Android → file-open-from-Files flow still works (Android handler unaffected)
  • Existing test suite still green

🤖 Generated with Claude Code

The file_handler MethodChannel introduced in Catrobat#146 is implemented
only on Android. On iOS, invokeMethod raises MissingPluginException
(distinct from PlatformException), which the existing try block
did not catch. main() crashed before runApp(), leaving the app
stuck on a white screen.

Catch MissingPluginException explicitly and no-op, since file
open-from-Files is not supported on iOS yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bakicelebi bakicelebi closed this May 19, 2026
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.

1 participant