Skip to content

[Bug]: Example code fails to execute on target (iOS) unless building/executing macOS /first/ #1764

@dgtlrift

Description

@dgtlrift

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

git clone https://github.com/Baseflow/flutter-geolocator.git
cd flutter-geolocator/geolocator_apple/example
<open Xcode and change Signing & Capabilities Team to your own team identifier>
flutter run
select iOS device - this was an iPhone 17 Pro running iOS 26.2
app loads and quickly fails with:

MacBook-Air:example user$ flutter run
Launching lib/main.dart on iPhone in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Automatically signing iOS for device deployment using specified development team in Xcode project: <redacted>
Running Xcode build...                                                  
Xcode build done.                                            6.0s
Installing and launching...                                        11.1s
Error connecting to the service protocol: failed to connect to http://127.0.0.1:50090/EIYnBnlOBo4=/ HttpException: Connection closed before full header was received, uri =
http://127.0.0.1:50090/EIYnBnlOBo4=/ws

app immediately fails with the above connection closed.

After attempting repeatedly in both flutter-geolocator/geolocator_apple/example and flutter-geolocator/geolocator/example with failure. Updating minimum platform supported (git clean clone set to iOS 13) to iOS 15.2, updating flutter lint minimum version - all of this failed with no success.

Attempted to validate issue on macOS, and app worked. Re-attempted on iOS then after, and now works.

Expected results

After a clean clone of the git repo, the example code should work.

App should load for iOS without first building for macOS

Actual results

Fails on iOS until first building for macOS.

Code sample

Code sample
git clone https://github.com/Baseflow/flutter-geolocator.git
cd flutter-geolocator/geolocator_apple/example
<open Xcode and change Signing & Capabilities Team to your own team identifier>
flutter run

Screenshots or video

Screenshots or video demonstration

Did not capture screen

Version

commit 756b8d8 (HEAD -> main, tag: geolocator_v14.0.2, origin/main, origin/HEAD)

Flutter Doctor output

Doctor output
MacBook-Air:example user$ flutter doctor -v
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.1 25B78 darwin-arm64, locale en-US) [489ms]
    • Flutter version 3.38.5 on channel stable at /opt/homebrew/share/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f6ff1529fd (3 weeks ago), 2025-12-11 11:50:07 -0500
    • Engine revision 1527ae0ec5
    • Dart version 3.10.4
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file,
      enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,474ms]
    • Android SDK at /Users/jhanley/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,717ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [5ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [6.0s]
    • JPH iPhone (mobile) • 00008150-0016515E3CB8401C • ios            • iOS 26.2 23C55
    • macOS (desktop)     • macos                     • darwin-arm64   • macOS 26.1 25B78 darwin-arm64
    • Chrome (web)        • chrome                    • web-javascript • Google Chrome 143.0.7499.170

[✓] Network resources [241ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions