Reputation: 365
Whenever I try to run a dart tool like Dart Migrate I get the following error and I am unable to run that tool. Is there a way to solve this problem or I have to reinstall Flutter?
Btw every thing is okay with Flutter Doctor
Upvotes: 10
Views: 18489
Reputation: 9
I was facing this issue because I have changed my Firebase account. I run the Firebase logout and the Firebase login command, after that, I was configuring a project but it was giving me this error. So I run the pub activate command which we run after the firebase CLI Install. Just run the below command, and it will fix it if you face the same issue.
dart pub global activate flutterfire_cli
Upvotes: 0
Reputation: 179
For me this problem appeared while trying to run an app on an iOS device (first appeared after adding a package, but persisted after removing the package dependency). I tried many things, but what finally resolved it was deleting the contents of the Xcode DerivedData directory. (I.e. Xcode -> Settings -> Locations, open DerivedData in Finder and delete its contents.)
Upvotes: 0
Reputation: 7424
dart pub global activate rps (or some other package)
After each update it invalids these packages.
Upvotes: 5
Reputation: 1
For me, trying to run pana and seeing this error, was just a metter or reinstalling it:
dart pub global activate pana
Upvotes: 0
Reputation: 1
Note that Instead of This "dart.sdkPath": "D:\Dart\dart-sdk\bin" work well for me. path should be included '\bin' also. It work for me
Upvotes: 0
Reputation: 995
dart.sdkPath
settingIf you get this in VS Code, in addition to re-downloading the dart-sdk, make sure the "dart.sdkPath" setting in user/workspace settings is pointing to the new SDK. In my case, even though I had it in my path as in Junaid's answer, VS Code was still looking to the old dart-sdk folder and giving me the kernel hash error. I updated the dart.sdkPath to the correct path and restarted VS Code:
For example, in Windows:
Download dart sdk
Unzip it to c:\tools\dart-sdk or any other folder (make sure you rename or delete the existing dart-sdk folder)
ctrl-shift-p
, type 'user settings (JSON)', open the json settings, and add:
"dart.sdkPath": "C:\\tools\\dart-sdk",
Update your system PATH environmental variable to point to the new dart-sdk and delete the reference to the old location.
Restart VS Code.
Upvotes: 1
Reputation: 365
After a lot of effort and wasting a lot of time on this issue I have been able to solve this problem. I have installed dart-sdk separately in the past and place the path of that dart-sdk at the top (before flutter one) in environment variables PATH. So I deleted that old dart-sdk path and deleted the respective folder this solved my problem.
Upvotes: 10