Comments (17)
It should be possible to set deviceId
in launch.json
. You can try adding "deviceId": "macos",
for osx
to see if it helps. It should override the setting.
from nativeshell.
I think I should update the template launch.json
:)
from nativeshell.
is the URL same as the URL printed when you run the app (cargo run)?
from nativeshell.
Oh it's not the same. The port is different
from nativeshell.
Which flutter version are you using? There was a regression recently in flutter tool debug attach caused by NNBD migration, but that should be resolved in latest master.
from nativeshell.
I'm on Flutter 2.6.0-1.0.pre.108 from 2 days ago.
from nativeshell.
I've also noticed that the last three digits of the port change randomly every time I try to attach vscode.
The vmservice file contains the exact same url that Nativeshell writes, but for some reason, flutter uses a different one.
from nativeshell.
I should also mention that this behavior isn't specific to my project. All nativeshell apps, including the example project, don't work. Normal flutter apps do.
from nativeshell.
So flutter is trying to attach to different port than the vmservice file? That looks like a bug in flutter tool. I'll see if I can reproduce this.
from nativeshell.
Can you try the following?
In one terminal
cargo run
In second
flutter attach -v -d macos --debug-url <http url printed during cargo run>
and post here the logs from flutter attach?
from nativeshell.
Here are the logs
[ +135 ms] executing: sysctl hw.optional.arm64
[ +34 ms] Exit code 0 from: sysctl hw.optional.arm64
[ +3 ms] hw.optional.arm64: 1
[ +9 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +29 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 334c95dbd919db697d849acad71a1d101d515181
[ +1 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git tag --points-at 334c95dbd919db697d849acad71a1d101d515181
[ +68 ms] Exit code 0 from: git tag --points-at 334c95dbd919db697d849acad71a1d101d515181
[ +2 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git describe --match *.*.* --long --tags 334c95dbd919db697d849acad71a1d101d515181
[ +53 ms] Exit code 0 from: git describe --match *.*.* --long --tags 334c95dbd919db697d849acad71a1d101d515181
[ ] 2.6.0-0.0.pre-161-g334c95dbd9
[ +12 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +17 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/master
[ ] executing: [/Users/wilson/Developer/SDK/flutter/] git ls-remote --get-url origin
[ +15 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +139 ms] Unable to locate an Android SDK.
[ +11 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git rev-parse --abbrev-ref HEAD
[ +24 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] master
[ +10 ms] executing: sw_vers -productName
[ +23 ms] Exit code 0 from: sw_vers -productName
[ ] macOS
[ ] executing: sw_vers -productVersion
[ +17 ms] Exit code 0 from: sw_vers -productVersion
[ ] 12.0
[ ] executing: sw_vers -buildVersion
[ +18 ms] Exit code 0 from: sw_vers -buildVersion
[ ] 21A5304g
[ +78 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +50 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +21 ms] executing: sysctl hw.optional.arm64
[ +10 ms] Exit code 0 from: sysctl hw.optional.arm64
[ ] hw.optional.arm64: 1
[ ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -version
[ +125 ms] Exit code 0 from: /usr/bin/arch -arm64e xcrun xcodebuild -version
[ ] Xcode 13.0
Build version 13A5154h
[ +1 ms] objc[59042]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x201ec5460) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10a4942c8). One of the two will be used. Which
one is undefined.
objc[59042]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x201ec54b0) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10a494318). One of the two will be
used. Which one is undefined.
[ +187 ms] Connecting to service protocol: http://127.0.0.1:62619/wwFZgAUGELw=/
[ +231 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:62619/wwFZgAUGELw=/.
[ +178 ms] DDS is listening at http://127.0.0.1:62662/7BApDUaiM3E=/.
[ +95 ms] Successfully connected to service protocol: http://127.0.0.1:62619/wwFZgAUGELw=/
[ +36 ms] DevFS: Creating new filesystem on the device (null)
[ +26 ms] DevFS: Created new filesystem on the device (file:///var/folders/nr/h5fpm1zn3y98b4skkg8l46gw0000gn/T/velicour2tZ5PF/velicour/)
[ +2 ms] Updating assets
[ +172 ms] Syncing files to device macOS...
[ +2 ms] <- reset
[ ] Compiling dart to kernel with 0 updated files
[ +9 ms] /Users/wilson/Developer/SDK/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/Users/wilson/Developer/SDK/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root
/Users/wilson/Developer/SDK/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter
--debugger-module-names --experimental-emit-debug-metadata --output-dill
/var/folders/nr/h5fpm1zn3y98b4skkg8l46gw0000gn/T/flutter_tools.CYkV6Y/flutter_tool.i3EO9b/app.dill --packages
/Users/wilson/Developer/Projects/velicour/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/cache.dill.track.dill --flutter-widget-cache
--enable-experiment=alternative-invalidation-strategy
[ +28 ms] <- compile package:velicour/main.dart
[+1489 ms] Activating Dart DevTools...
[+3261 ms] Activating Dart DevTools... (completed in 3.2s)
[+3397 ms] Updating files.
[ +1 ms] DevFS: Sync finished
[ +2 ms] Syncing files to device macOS... (completed in 8.2s)
[ +4 ms] Synced 0.0MB.
[ +3 ms] <- accept
[ +3 ms] Connected to _flutterView/0x7ff3ad877e20.
[ +24 ms] Flutter run key commands.
[ +3 ms] r Hot reload. 🔥🔥🔥
[ +9 ms] R Hot restart.
[ ] h List all available interactive commands.
[ +2 ms] d Detach (terminate "flutter run" but leave application running).
[ ] c Clear the screen
[ ] q Quit (terminate the application on the device).
[ ] 💪 Running with sound null safety 💪
[ +2 ms] An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:62662/7BApDUaiM3E=/
[ +3 ms] The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:62662/7BApDUaiM3E=/
It suddenly started working again after doing nothing for a few hours. But the problem usually reoccurs after a while. I'll post the logs once I face it again.
from nativeshell.
Just started facing this issue again. The logs are pretty synonymous with the previous logs.
flutter attach -v -d macos --debug-url http://127.0.0.1:50445/8Yi_Kjwp5QU=/
[ +136 ms] executing: sysctl hw.optional.arm64
[ +32 ms] Exit code 0 from: sysctl hw.optional.arm64
[ +3 ms] hw.optional.arm64: 1
[ +9 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +39 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 334c95dbd919db697d849acad71a1d101d515181
[ +1 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git tag --points-at 334c95dbd919db697d849acad71a1d101d515181
[ +83 ms] Exit code 0 from: git tag --points-at 334c95dbd919db697d849acad71a1d101d515181
[ +2 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git describe --match *.*.* --long --tags 334c95dbd919db697d849acad71a1d101d515181
[ +50 ms] Exit code 0 from: git describe --match *.*.* --long --tags 334c95dbd919db697d849acad71a1d101d515181
[ ] 2.6.0-0.0.pre-161-g334c95dbd9
[ +12 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +17 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/master
[ ] executing: [/Users/wilson/Developer/SDK/flutter/] git ls-remote --get-url origin
[ +18 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +153 ms] Unable to locate an Android SDK.
[ +10 ms] executing: [/Users/wilson/Developer/SDK/flutter/] git rev-parse --abbrev-ref HEAD
[ +21 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] master
[ +8 ms] executing: sw_vers -productName
[ +29 ms] Exit code 0 from: sw_vers -productName
[ ] macOS
[ ] executing: sw_vers -productVersion
[ +22 ms] Exit code 0 from: sw_vers -productVersion
[ ] 12.0
[ ] executing: sw_vers -buildVersion
[ +23 ms] Exit code 0 from: sw_vers -buildVersion
[ ] 21A5304g
[ +65 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +48 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +20 ms] executing: sysctl hw.optional.arm64
[ +12 ms] Exit code 0 from: sysctl hw.optional.arm64
[ ] hw.optional.arm64: 1
[ ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -version
[ +127 ms] Exit code 0 from: /usr/bin/arch -arm64e xcrun xcodebuild -version
[ ] Xcode 13.0
Build version 13A5154h
[ +1 ms] objc[24804]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x215fa9460) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106f942c8). One of the two will be used.
Which one is undefined.
objc[24804]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x215fa94b0) and
/Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106f94318). One of the two will
be used. Which one is undefined.
[ +182 ms] Connecting to service protocol: http://127.0.0.1:50445/8Yi_Kjwp5QU=/
[ +255 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:50445/8Yi_Kjwp5QU=/.
[ +139 ms] DDS is listening at http://127.0.0.1:50468/7EpInU_Pc7Q=/.
[ +76 ms] Successfully connected to service protocol: http://127.0.0.1:50445/8Yi_Kjwp5QU=/
[ +48 ms] DevFS: Creating new filesystem on the device (null)
[ +22 ms] DevFS: Created new filesystem on the device (file:///var/folders/nr/h5fpm1zn3y98b4skkg8l46gw0000gn/T/velicourv8LILc/velicour/)
[ +2 ms] Updating assets
[ +187 ms] Syncing files to device macOS...
[ +2 ms] <- reset
[ ] Compiling dart to kernel with 0 updated files
[ +9 ms] /Users/wilson/Developer/SDK/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/Users/wilson/Developer/SDK/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root
/Users/wilson/Developer/SDK/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter
--debugger-module-names --experimental-emit-debug-metadata --output-dill
/var/folders/nr/h5fpm1zn3y98b4skkg8l46gw0000gn/T/flutter_tools.l6nQ12/flutter_tool.AeCypx/app.dill --packages
/Users/wilson/Developer/Projects/velicour/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/cache.dill.track.dill --flutter-widget-cache
--enable-experiment=alternative-invalidation-strategy
[ +45 ms] <- compile package:velicour/main.dart
[+1615 ms] Activating Dart DevTools...
[+3343 ms] Activating Dart DevTools... (completed in 3.3s)
[+2920 ms] Updating files.
[ +7 ms] DevFS: Sync finished
[ +3 ms] Syncing files to device macOS... (completed in 7.9s)
[ +2 ms] Synced 0.0MB.
[ +4 ms] <- accept
[ +25 ms] Connected to _flutterView/0x7fe607100a20.
[ +18 ms] Flutter run key commands.
[ +13 ms] r Hot reload. 🔥🔥🔥
[ +3 ms] R Hot restart.
[ ] h List all available interactive commands.
[ ] d Detach (terminate "flutter run" but leave application running).
[ ] c Clear the screen
[ +4 ms] q Quit (terminate the application on the device).
[ ] 💪 Running with sound null safety 💪
[ +1 ms] An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:50468/7EpInU_Pc7Q=/
[ +5 ms] The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9100?uri=http://127.0.0.1:50468/7EpInU_Pc7Q=/
from nativeshell.
The logs looks good. You can capture logs from dart-code as well (Dart: Capture Debugging Logs
in vscode) - do they show anything different?
from nativeshell.
Before "connecting to service protocol", it shows this:
[ +199 ms] Attempting to forward device port 50445 to host port 50695
[ +1 ms] executing: /Users/wilson/Developer/SDK/flutter/bin/cache/artifacts/usbmuxd/iproxy 50695:50445 --udid 00008020-001934582144002E --debug
[+1028 ms] Forwarded port ForwardedPort HOST:50695 to DEVICE:50445
The original port shown in the url is 50445, but Dart code is forwarding 50695 to it
from nativeshell.
iproxy shouldn't be involved. That's when you're debugging on a device. Is the selected device in vscode (status bar option) macOS
?
from nativeshell.
Ah, that was the problem. The device changed automatically when I plugged in a new one. Setting it back to macOS fixed it. Thanks for the help!
from nativeshell.
Overriding the deviceId
works great. Thanks!
from nativeshell.
Related Issues (20)
- Crashes on multiple monitors in Windows HOT 4
- Is there any way to lower the minimum supported version of macOS HOT 1
- way to run existing flutter code HOT 4
- How to specify libflutter location
- Frameless windows are not resizable on macOS
- Fails to build on apple silicon with Flutter 3.0.0 HOT 2
- The Flutter Attach to Process gets stuck on Waiting... HOT 3
- Invalid read causes segmentation fault HOT 3
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- std::rc::Weak<ContextImpl>` cannot be sent between threads safely
- MenuItem clash with flutter widget of the same name HOT 1
- Getting an error when trying to run the examples HOT 2
- Build Error on MacOS 13.2.1 - cargo run or cargo run --release unable to build and run the flutter app for example provided
- Issues with native plugin `media_kit` HOT 2
- Latest SharedPreferences not working HOT 1
- Jitter when resizing on Windows when frame is `WindowFrame.noTitle` HOT 1
- Unable to build sample project HOT 2
- [super_context_menu] Change/Remove Progress Indicator for DeferredMenuElement
- Calling dart from rust side?
- Support current stable version of Flutter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativeshell.