Pub does not load dependencies on Windows 7 after updating to lib v2 (SDK 0.3.1_r17328)
After upgrading to version 0.3.1_r17328 from Dart SDK and Dart Editor, I have some problems importing Args library library. I have the same problem either importing Args directly, or importing Web_ui where Args is one of the dependencies.
Here is my pubspec.yaml:
name: notes description: A sample application dependencies: web_ui: 0.3.0+1
or
name: notes description: A sample application dependencies: args: 0.3.1+1
Here is the error generation from build.dart
Unable to open file: C:/Users/Fabio/Dropbox/progetti/note/packages/args/args.dart'package:web_ui/component_build.dart': Error: line 25 pos 1: library handler failed import 'package:args/args.dart'; 'file:///C:/Users/Fabio/Dropbox/progetti/note/build.dart': Error: line 1 pos 1: library handler failed import 'package:web_ui/component_build.dart';
source to share
Unfortunately I was getting the same error with my Windows XP machine.
Eventually, I logged into my Windows 7 machine and was able to download the packages, zip them, and paste the libraries into my Windows XP dart editor. Success!
I had no reason to believe that I had the exact problem with @shindokaku's proxy when using my home computer.
I tried all suggestions for deleting .cache, pub.lock and packages folder and retrying. I removed the dart editor and tried again. I have also tried using git resources to download web-ui and execute commands via command line to no avail
Including suggestions on similar issues:
source to share
This problem has plagued me over and over again for several weeks. I am not using Windows, so this answer is not meant to help the original poster that Windows 7 uses.
If you are using Linux, here are the steps I use to repair a corrupted pub cache.
Go to the top level directory of your application. You should see at least pubspec.lock, pubspec.yaml, a folder with package names, and a folder named web. Delete the pubspec.lock folder and folder.
[Make sure you don't store your own libraries in the folder with folders]
cd ~/dart/myApp/
rm -r packages
rm pubspec.lock
Now that you've removed these files:
pub cache repair
Note 1: if your dart-sdk is not in your $ PATH systems, you will use the absolute path to the sdk when using the above command. Please comment if you need it.
Note 2: This is a working solution with Dart 1.5.3. I have not tested this on earlier versions.
source to share