Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error: Did not find a Dart VM Service advertised for xxx #151328

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

Open
hugaveme opened this issue Jul 5, 2024 · 20 comments
Open

Error: Did not find a Dart VM Service advertised for xxx #151328

hugaveme opened this issue Jul 5, 2024 · 20 comments
Labels
needs repro info Automated crash report whose cause isn't yet known 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

@hugaveme
Copy link

hugaveme commented Jul 5, 2024

Steps to reproduce

1.flutter Create a new project
2.flutter run -v

Expected results

Ability to enter debug mode, hot-load debugging possible.

Actual results

Error: Did not find a Dart VM Service advertised for xxx

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
The Dart VM Service was not discovered after 60 seconds. This is taking much longer than expected...
Open the Xcode window the project is opened in to ensure the app is running. If the app is not running, try selecting "Product > Run" to fix the problem.
[ +5 ms] Checking for advertised Dart VM Services...
[+1994 ms] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[+5005 ms] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[+5004 ms] Unexpectedly found more than one Dart VM Service report for
com.example.vmcs._dartVmService._tcp.local - using first one
(54292).
[ +3 ms] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ ] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[+3348 ms] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[ +4 ms] Checking for available port on
com.example.vmcs._dartVmService._tcp.local
[+44636 ms] The Dart VM Service was not discovered after 60 seconds. This is
taking much
longer than expected...
[ +1 ms] Open the Xcode window the project is opened in to ensure the app is
running. If
the app is not running, try selecting "Product > Run" to fix the
problem.
[ ] No path provided for Symbols directory.
Error: Did not find a Dart VM Service advertised for xxx 

Flutter Doctor output

Doctor output
Apple M3 Pro
MacOS:14.5 (23F79)

Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2

Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale
zh-Hans-CN)
• Flutter version 3.22.2 on channel stable at /Users/22hu/Desktop/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (4 weeks ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
@hugaveme
Copy link
Author

hugaveme commented Jul 5, 2024

[   +3 ms] 
           #0      throwToolExit
(package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand
           (package:flutter_tools/src/commands/run.dart:840:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand
(package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand
           (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure>
           (package:flutter_tools/runner.dart:130:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:93:3)
           <asynchronous suspension>

@huycozy huycozy added the in triage Presently being triaged by the triage team label Jul 5, 2024
@huycozy
Copy link
Member

huycozy commented Jul 5, 2024

Hi @hugaveme
Are you targeting iOS or macOS platform? Also, will the error disappear if you follow this hint from the error output:

the app is not running, try selecting "Product > Run" to fix the

Please provide the entire output of flutter run -v. The output may be too large to be uploaded to GitHub, you may upload it as a txt file or use online tools like https://pastebin.com/ to share it. Thanks!

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 5, 2024
@hugaveme
Copy link
Author

hugaveme commented Jul 5, 2024

output.txt
Here is the complete log.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 5, 2024
@huycozy
Copy link
Member

huycozy commented Jul 8, 2024

Thanks, I can see the build failed on iPhone 13 (iPhone14,5) from your log above. Is your iPhone wire or wireless paired? (could be related: #144634). And will the error disappear if you follow this hint from the error output:

the app is not running, try selecting "Product > Run" to fix the

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 8, 2024
@hugaveme
Copy link
Author

hugaveme commented Jul 8, 2024

I am using wired debugging and can run the project using xcode. However, the same problem occurs when running flutter.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 8, 2024
@huycozy
Copy link
Member

huycozy commented Jul 8, 2024

Thanks for your response. I can't reproduce this issue, will label this for input from others.

@huycozy huycozy added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. needs repro info Automated crash report whose cause isn't yet known team-ios Owned by iOS platform team and removed in triage Presently being triaged by the triage team labels Jul 8, 2024
@jmagman
Copy link
Member

jmagman commented Jul 24, 2024

[ ] No path provided for Symbols directory.

Related to #127875

@cbracken
Copy link
Member

Quick question:

  • What is the output of flutter devices --verbose?
  • If you open the Devices and Simulators window in Xcode (Cmd-Shift-2), does the device appear paired, or show any warnings?

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 24, 2024
@cbracken
Copy link
Member

Looks like output suggests the phone actually is connected, so I wonder if the bug is in our port forwarding via iproxy?

From the log attached above.

[+1056 ms] Devices:
           Name        Hostname                      Identifier                             State       Model                 
           ---------   ---------------------------   ------------------------------------   ---------   ----------------------
           22的iPhone   22deiPhone.coredevice.local   D0C89C8D-FAA5-4C0A-9333-9CD3C5F4A956   connected   iPhone 13 (iPhone14,5)

@hugaveme
Copy link
Author

I don't quite understand how you confirm the forwarding error about iproxy above. What can I do to provide the information you need?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 25, 2024
@cbracken
Copy link
Member

I don't quite understand how you confirm the forwarding error about iproxy above. What can I do to provide the information you need?

Sorry that was more of a comment to myself and anyone else who's trying to repro this. I'll do some local exploration to see if I can find a nice way to collect info to verify whether iproxy is properly forwarding or not.

@hellohuanlin
Copy link
Contributor

I remember i occasionally had this before. My fix was to restart the computer.

@hellohuanlin hellohuanlin added P2 Important issues not at the top of the work list triaged-ios Triaged by iOS platform team labels Jul 31, 2024
@hugaveme
Copy link
Author

hugaveme commented Aug 1, 2024

I have tried restarting the computer but it doesn't work. I also found that there is no problem debugging through the Xcode simulator, and the VM can start normally; but real machine debugging does not work.

@nunupy345345
Copy link

I tried this https://flutter.keicode.com/devenv/flutter-on-mac-catalina.php (Sorry for the Japanese article.)
It worked!

@cbracken
Copy link
Member

cbracken commented Aug 20, 2024

I tried this https://flutter.keicode.com/devenv/flutter-on-mac-catalina.php (Sorry for the Japanese article.)

Interesting; that should only be necessary when running unsigned (or incorrectly signed) binaries. This shouldn't be necessary though since we codesign the libimobiledevice binaries we distribute in the Flutter SDK.

Out of curiosity, can you try two things in a terminal and let me know the output? I'm interested in answers from both @nunupy345345 and @hugaveme.

  1. Run which iproxy. This will tell us if you've got another version of iproxy installed somewhere on $PATH.
% which iproxy
iproxy not found
  1. cd into your Flutter SDK directory, and check the code signature on iproxy. This will verify it has a valid signature:
% codesign -dv --verbose=4 bin/cache/artifacts/usbmuxd/iproxy
Executable=/Users/cbracken/Developer/flutter/flutter/bin/cache/artifacts/usbmuxd/iproxy
Identifier=iproxy
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=498 flags=0x10000(runtime) hashes=7+5 location=embedded
VersionPlatform=1
VersionMin=658944
VersionSDK=658944
Hash type=sha256 size=32
CandidateCDHash sha256=0708007ef94a7b90f044272d4776de7a10dea6f8
CandidateCDHashFull sha256=0708007ef94a7b90f044272d4776de7a10dea6f8a08e8fb5865841d1a9a6fc99
Hash choices=sha256
CMSDigest=0708007ef94a7b90f044272d4776de7a10dea6f8a08e8fb5865841d1a9a6fc99
CMSDigestType=2
Page size=4096
CDHash=0708007ef94a7b90f044272d4776de7a10dea6f8
Signature size=8979
Authority=Developer ID Application: FLUTTER.IO LLC (S8QB4VV633)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=2020-09-02 at 17:16:31
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=10.14.0
Sealed Resources=none
Internal requirements count=1 size=168

@jmagman
Copy link
Member

jmagman commented Aug 20, 2024

Also please provide:
3.

spctl -a -vvv -t  install bin/cache/artifacts/usbmuxd/iproxy

(it's notarization that matters, in addition to codesigning)

@nunupy345345
Copy link

nunupy345345 commented Aug 27, 2024

@jmagman
Sorry for the delay, thanks for the reply.
1.

iproxy not found 
Executable=/usr/local/Caskroom/flutter/3.22.3/flutter/bin/cache/artifacts/usbmuxd/iproxy
Identifier=iproxy
Format=Mach-O thin (x86_64)
CodeDirectory v=20500 size=498 flags=0x10000(runtime) hashes=7+5 location=embedded
VersionPlatform=1
VersionMin=658944
VersionSDK=658944
Hash type=sha256 size=32
CandidateCDHash sha256=0708007ef94a7b90f044272d4776de7a10dea6f8
CandidateCDHashFull sha256=0708007ef94a7b90f044272d4776de7a10dea6f8a08e8fb5865841d1a9a6fc99
Hash choices=sha256
CMSDigest=0708007ef94a7b90f044272d4776de7a10dea6f8a08e8fb5865841d1a9a6fc99
CMSDigestType=2
Page size=4096
CDHash=0708007ef94a7b90f044272d4776de7a10dea6f8
Signature size=8979
Authority=Developer ID Application: FLUTTER.IO LLC (S8QB4VV633)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Sep 3, 2020 at 9:16:31
Info.plist=not bound
TeamIdentifier=S8QB4VV633
Runtime Version=10.14.0
Sealed Resources=none
Internal requirements count=1 size=168 
spctl -a -vvv -t install bin/cache/artifacts/usbmuxd/iproxy
bin/cache/artifacts/usbmuxd/iproxy: accepted
source=Notarized Developer ID
origin=Developer ID Application: FLUTTER.IO LLC (S8QB4VV633) 

@hugaveme
Copy link
Author

我试过这个https://flutter.keicode.com/devenv/flutter-on-mac-catalina.php(对日本文章感到抱歉。)奏效了!

The problem I encountered was that the Dart VM Service could not start normally, which resulted in the inability to use hot loading when the app and the phone were debugged. I did not encounter any warnings similar to the above.

@hugaveme
Copy link
Author

spctl -a -vvv -t install bin/cache/artifacts/usbmuxd/iproxy

The above operation still cannot solve the problem. But I found that when debugging with the simulator of Xcode, the Dart VM Service can be started normally.

@nick4fake
Copy link

Doesn't work for wireless connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro info Automated crash report whose cause isn't yet known 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