Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running iOS app gets stuck on "Waiting for VM Service port to be available..." when EXECUTABLE_NAME and PRODUCT_NAME don't match #129246

Open
2 tasks done
GrzesiekZbozien opened this issue Jun 21, 2023 · 9 comments
Labels
found in release: 3.10 Found to occur in 3.10 found in release: 3.12 Found to occur in 3.12 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team

Comments

@GrzesiekZbozien
Copy link

Is there an existing issue for this?

Steps to reproduce

  1. Create custom ios scheme/target configuration - using xcodegen
  2. Start ios app by using: flutter run -v -d iphone --target lib/main_test1.dart --flavor test1

Initially issue reported here: Dart-Code/Dart-Code#4593 but seems like flutter issue nor dart-code

Expected results

iOS app starts.

Actual results

App gets stuck at:
Waiting for VM Service port to be available...
Running app form Xcode works just fine.

Code sample

Code sample

Created project here:
https://github.com/GrzesiekZbozien/tst-flutter

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[   +3 ms] executing: /usr/bin/arch -arm64e xcrun simctl launch AD01A496-2591-4031-93F3-AE49F9B91E2C com.example.test1 --enable-dart-profiling --enable-checked-mode --verify-entry-points
[ +510 ms] com.example.test1: 14769
[        ] Waiting for VM Service port to be available...

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale pl-PL)
    • Flutter version 3.10.5 on channel stable at /Users/grzegorz/Documents/flutter-repo/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (7 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/grzegorz/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

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

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] Connected device (4 available)
    • iPhone 14 Pro Max (mobile) • 9C50A24D-DFA0-4502-8FAF-82CE18BEB980 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • iPhone 14 Pro (mobile)     • AD01A496-2591-4031-93F3-AE49F9B91E2C • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 114.0.5735.133

[✓] Network resources
    • All expected network resources are available.
@dam-ease
Copy link

Hi @GrzesiekZbozien. Thanks for filing this issue. I can confirm this issue is only reproducible on vscode and not on Android Studio or XCode.

flutter doctor -v

[✓] Flutter (Channel master, 3.12.0-7.0.pre.43, on macOS 13.4 22F66 darwin-arm64, locale en-NG)
    • Flutter version 3.12.0-7.0.pre.43 on channel master at /Users/dammya/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 88d6539e61 (4 hours ago), 2023-06-21 02:53:18 -0400
    • Engine revision 946f523859
    • Dart version 3.1.0 (build 3.1.0-235.0.dev)
    • DevTools version 2.24.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/dammya/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • ANDROID_HOME = /Users/dammya/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

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

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.79.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.50.0

[✓] Connected device (6 available)
    • sdk gphone arm64 (mobile)  • emulator-5554                            • android-arm64  • Android 11 (API 30) (emulator)
    • Damilola’s iPhone (mobile) • 71c843fa5f3dec767999f36224653c0faa78660e • ios            • iOS 16.5 20F66
    • iPhone 14 (mobile)         • 5FE8DE93-0F4C-45BA-8BED-BC9CD69B35D1     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • iPhone 14 Pro (mobile)     • DCF2031A-7EA9-42FF-8CD4-D4584F3E7A6D     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                    • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)               • chrome                                   • web-javascript • Google Chrome 114.0.5735.133

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

• No issues found!

@dam-ease dam-ease added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.10 Found to occur in 3.10 found in release: 3.12 Found to occur in 3.12 and removed in triage Presently being triaged by the triage team labels Jun 21, 2023
@christopherfujino
Copy link
Member

Hi @GrzesiekZbozien. Thanks for filing this issue. I can confirm this issue is only reproducible on vscode and not on Android Studio or XCode.

@vashworth this is interesting...

@vashworth
Copy link
Contributor

I'm able to reproduce this locally. I'll see if I can pinpoint the issue.

@vashworth vashworth self-assigned this Jun 21, 2023
@DanTup
Copy link
Contributor

DanTup commented Jun 21, 2023

Hi @GrzesiekZbozien. Thanks for filing this issue. I can confirm this issue is only reproducible on vscode and not on Android Studio or XCode.

@vashworth this is interesting...

I haven't tried Android Studio or Xcode, but FWIW in the original report it seemed like it was only from VS Code and worked from the terminal - but that's because "worked" meant "the app became visible" (whereas in VS Code it was just a white screen). This was just a symptom of VS Code starting the app paused (so failing to get a VM Service meant the app was never unpaused). The issue does actually occur from the terminal but because the app isn't started paused (unless you pass --start-paused), the app visibly loads and it might look like the issue isn't occurring.

I don't know if that's what happened with AS/Xcode above, but thought it worth noting (my notes on looking at this are at Dart-Code/Dart-Code#4593 (comment)).

@christopherfujino
Copy link
Member

Hi @GrzesiekZbozien. Thanks for filing this issue. I can confirm this issue is only reproducible on vscode and not on Android Studio or XCode.

@vashworth this is interesting...

I haven't tried Android Studio or Xcode, but FWIW in the original report it seemed like it was only from VS Code and worked from the terminal - but that's because "worked" meant "the app became visible" (whereas in VS Code it was just a white screen). This was just a symptom of VS Code starting the app paused (so failing to get a VM Service meant the app was never unpaused). The issue does actually occur from the terminal but because the app isn't started paused (unless you pass --start-paused), the app visibly loads and it might look like the issue isn't occurring.

I don't know if that's what happened with AS/Xcode above, but thought it worth noting (my notes on looking at this are at Dart-Code/Dart-Code#4593 (comment)).

Thanks for clarifying

@vashworth
Copy link
Contributor

Okay so I've identified the issue. So this issue is occurring because the demo code has a custom EXECUTABLE_NAME. Flutter does not handle the custom name and therefore this issue occurs.

Workaround: Make sure the EXECUTABLE_NAME and PRODUCT_NAME match.

Long term solution: Flutter should handle the custom executable name by getting it from the build settings and adding it here:

if (appName != null) 'processImagePath ENDSWITH "$appName"',

So something like

if (appName != null) '(processImagePath ENDSWITH "$appName" OR processImagePath ENDSWITH "$executableName")',

@GrzesiekZbozien
Copy link
Author

GrzesiekZbozien commented Jun 22, 2023

@vashworth thanks. Workaround did a trick.

PRODUCT_NAME: ${executableName} EXECUTABLE_NAME: ${executableName}
in xcodegen project spec was enough

Thanks all involved for helping :)

@vashworth vashworth removed their assignment Jun 22, 2023
@vashworth vashworth added the P2 Important issues not at the top of the work list label Jun 22, 2023
@stuartmorgan stuartmorgan changed the title Running iOS app gets stuck on "Waiting for VM Service port to be available..." Running iOS app gets stuck on "Waiting for VM Service port to be available..." when EXECUTABLE_NAME and PRODUCT_NAME don't match Jun 26, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@BenjiFarquhar
Copy link
Contributor

I have this exact error and am not sure how to fix it. Where do we set EXECUTABLE_NAME? It is not in my project at all except for macos which I am not even supporting.

@GrzesiekZbozien
Copy link
Author

@BenjiFarquhar are you using xcodegen?
If yes, then add same name for both PRODUCT_NAME: ${executableName} and EXECUTABLE_NAME: ${executableName}.
If no this issue shouldn't occur as far as I know, but maybe somewhere it changed, you should search project files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
found in release: 3.10 Found to occur in 3.10 found in release: 3.12 Found to occur in 3.12 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team
Projects
None yet
Development

No branches or pull requests

7 participants