This content originally appeared on DEV Community and was authored by Alpha
While working on a Flutter app targeting iOS simulators, I ran into a frustrating error that appeared out of nowhere:
"Error connecting to the service protocol: failed to connect to http://127.0.0.1:51062..."
This was immediately followed by a native macOS crash dialog:
"Runner quit unexpectedly."
Every time I clicked "Reopen," it just crashed again. The Flutter console eventually started spitting out this during hot restart:
Failed to Hot Restart: DebugAdapterException: app 'xxxx-xxxx' not found
First Aid: What to Try
Every Flutter developer should run through these first-line recovery steps. These often fix transient or setup-related issues.
1. Clean Everything
flutter clean
rm -rf ios/Pods ios/Podfile.lock pubspec.lock .dart_tool
flutter pub get
cd ios && pod install && cd ..
flutter run
Why? iOS builds cache native binaries and CocoaPods configs aggressively. Any inconsistency in plugin versions or native code will be left behind if not fully wiped.
2. Reboot Simulators
xcrun simctl shutdown all
xcrun simctl erase all
Why? Simulators can become corrupted, especially after Xcode or iOS runtime updates. Resetting clears all app data and memory state.
4. Check connected Devices
flutter devices
If it’s stuck on a simulator that no longer boots, pick another one:
open -a Simulator
5. Run Flutter Doctor
flutter doctor -v
Look for anything red or yellow, especially issues with:
- Xcode Command Line Tools
- CocoaPods
- iOS Toolchain
5. Restart Everything
Sometimes macOS itself blocks port bindings or simulator-to-Dart VM communication. Restart your IDE, Terminal, Simulator, and if all else fails, your Mac.
If you’ve tried all the above and still get:
“Runner quit unexpectedly”
"Service protocol connection failed"
"Hot restart failed: app not found"
...then you’re not dealing with a Dart error anymore. You’re likely hitting a native iOS crash. At this point:
You need to investigate why the app crashes before the Dart VM boots.
The Breakthrough: Reading the Crash
In my case, none of the band aid worked and I was bleeding time and patience. There was insufficient message and errors to work with so I did the next best thing.
Ran the code directly from Xcode. This gave me a goldmine of crash logs, and hiding in the crowd was this:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Duplicate plugin key: VideoThumbnailPlugin'
A native plugin registration conflict.
Root Cause: Duplicate Plugin Registration
Earlier I had thought about getting thumbnails from a video URL and I added "video thumbnail" package forgetting I already had a similar one from a different implementation but my pubspec.yaml looked like this:
video_thumbnail: ^...
get_thumbnail_video: ^...
Both plugins register the same iOS native plugin name: VideoThumbnailPlugin. Flutter on iOS does not allow two plugins to register with the same key, and this causes an Objective-C crash during app launch.
The Solution
Option 1: Remove the Duplicate Plugin
Keep only one of the conflicting plugins in your pubspec.yaml.
Then rebuild:
flutter clean
flutter pub get
cd ios && pod install && cd ..
flutter run
Option 2: Rename the Plugin (If You Forked It)
If you forked one of the plugins (e.g., get_thumbnail_video), you must:
Rename the Objective-C class in ios/Classes/VideoThumbnailPlugin.m:
@implementation GetVideoThumbnailPlugin // ← renamed
Rename the registration function and key to avoid clashing with the original.
Once the conflict was removed, everything worked again:
The Flutter app launched
Service protocol connected
Hot reload and devtools worked as expected
Key Lessons
Flutter’s native iOS plugins must have unique registration keys.
A duplicate plugin crash happens before Dart is even loaded, so it won’t show in normal flutter run logs.
Always try first aid steps before assuming your code is broken — but know when to dig into native logs.
Use xcrun simctl or run the app from Xcode when things go wrong. It can save you hours.
iOS crashes in Flutter can be deceptive. If your app dies before main() runs, always suspect:
Plugin conflicts
Info.plist issues
Native code changes (especially after plugin updates)
Debugging these crashes takes patience, but knowing what to check and in what order will save you a lot of frustration.
Happy Coding
This content originally appeared on DEV Community and was authored by Alpha

Alpha | Sciencx (2025-07-07T21:41:00+00:00) Solving a Flutter iOS Crash: Service Protocol Failures & Plugin Collisions. Retrieved from https://www.scien.cx/2025/07/07/solving-a-flutter-ios-crash-service-protocol-failures-plugin-collisions/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.