Fix iOS crash on startup from missing file_handler plugin#163
Closed
bakicelebi wants to merge 1 commit into
Closed
Fix iOS crash on startup from missing file_handler plugin#163bakicelebi wants to merge 1 commit into
bakicelebi wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MissingPluginExceptionfrom theorg.catrobat.paintroid/file_handlerMethodChannel (introduced in [PAINTROID - 776] Second instance of app is opened when catrobat image is opened from files #146). The existingtryonly catchesPlatformException, which is a distinct class —main()crashes beforerunApp(), leaving a white screen.on MissingPluginExceptioncatch 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)
flutter run -d <ios-simulator>on current developUnhandled Exception: MissingPluginException(No implementation found for method getInitialFile on channel org.catrobat.paintroid/file_handler)originating in lib/main.dart:40Test plan
flutter runon iOS simulator → app reaches Pocket Paint home screenflutter runon Android → file-open-from-Files flow still works (Android handler unaffected)🤖 Generated with Claude Code