Skip to content

The method 'toFilePath' was called on null #1497

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

Closed
apaolino opened this issue Dec 23, 2019 · 4 comments
Closed

The method 'toFilePath' was called on null #1497

apaolino opened this issue Dec 23, 2019 · 4 comments

Comments

@apaolino
Copy link

apaolino commented Dec 23, 2019

When I open devTools on last flutter stable version (1.12.13+hotfix5) it crashes. I captured this log:

Dart Code extension: 3.7.1
Flutter extension: 3.7.1 (not activated)
VS Code: 1.41.1
Platform: win
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: C:\Users\ThinkPad\Documents\Development\Flutter_SDK\flutter_new\bin\cache\dart-sdk
Ver: 2.7.0-dev.2.1
Flutter SDK:
Loc: C:\Users\ThinkPad\Documents\Development\Flutter_SDK\flutter_new
Ver: 1.12.13+hotfix.5
HTTP_PROXY: undefined
NO_PROXY: undefined

Mon Dec 23 2019 [12:41:01 GMT+0100 (Ora standard dell’Europa centrale)] Log file started
[12:41:07] [DevTools] [Info] Spawning C:\Users\ThinkPad\Documents\Development\Flutter_SDK\flutter_new\bin\cache\dart-sdk\bin\pub.bat with args ["global","run","devtools","--machine","--enable-notifications","--try-ports","10"]
[12:41:07] [DevTools] [Info] PID: 3584
[12:41:07] [DevTools] [Error] Unhandled exception:
[12:41:07] [DevTools] [Error]
NoSuchMethodError: The method 'toFilePath' was called on null.
Receiver: null
Tried calling: toFilePath()
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
#1 defaultHandler (package:devtools_server/src/handlers.dart:28:60)

#2 serveDevTools (package:devtools_server/src/server.dart:143:21)
#3 serveDevToolsWithArgs (package:devtools_server/src/server.dart:99:10)
#4 main (file:///C:/Users/ThinkPad/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/devtools-0.1.13/bin/devtools.dart:9:3)
#5 _startIsolate. (dart:isolate-patch/isolate_patch.dart:305:32)
#6 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
[12:41:07] [DevTools] [Info] Process terminated! 255, null
[12:41:07] [General] [Error] Dart DevTools exited with code 255
[12:41:07] [General] [Error] Dart DevTools exited with code 255
Mon Dec 23 2019 [12:41:10 GMT+0100 (Ora standard dell’Europa centrale)] Log file ended

@doppio
Copy link

doppio commented Jan 1, 2020

I'm seeing the same issue. I'm able to run DevTools if I manually run flutter pub global run devtools, flutter run, and paste the URL into http://127.0.0.1:9100/. I just can't use VS Code to debug my app and open DevTools, which would be far more convenient.

@doppio
Copy link

doppio commented Jan 1, 2020

I found a solution, @apaolino! I just removed my pub cache files (in your case, located at C:/Users/ThinkPad/AppData/Roaming/Pub/Cache). It works now. 🎉

@apaolino
Copy link
Author

apaolino commented Jan 6, 2020

Hi, thanks for suggestion! in particular I deleted only the C:\Users\ThinkPad\AppData\Roaming\Pub\Cache\global_packages\devtools and it works!

@sunjianan9900
Copy link

Hi, thanks for suggestion! in particular I deleted only the C:\Users\ThinkPad\AppData\Roaming\Pub\Cache\global_packages\devtools and it works!

do you know what's the mac path ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants