Missing Package in AngularDart - dart

I try to use AngularDart according to the AngularDart.com Tutorial.
My pubspec.yaml:
name: test
description: A sample web application
dependencies:
angular: "1.0.0"
web_components: ">=0.8.0 <0.9.0"
browser: ">=0.10.0+2 <0.11.0"
transformers:
- angular
Always when i run pub get, i get the following error:
--- 09:24:30 Running pub get on D:\Bachelorarbeit_Projekt\Source\notices ... ---
Resolving dependencies...
Got dependencies!
Precompiling dependencies...
Loading source assets...
Loading di/module_transformer and smoke/src/default_transformer transformers...
Transformer library "package:di/module_transformer.dart" not found.
I tried with Eclipse plugin and Dart Editor.
Have no more ideas...

I deleted AppData\Roaming\Pub\ manually...
Then it worked

pub cache repair can't fix a broken cache in the case of a missing pubspec.yaml file.
In this case delete the folder of the faulty package within the pub cache.
This is a known issue (see http://dartbug.com/21418 and http://dartbug.com/21408)

I tried manually deleting the directory which still didn't work, then I did 'pub upgrade' which ended up working.

Related

Dart's pub get command can't find latest versions of some dependencies

I've noticed on a few occasions that when I setup some dependencies in my pubspec.yaml pointing to the latest version, they aren't found when I run pub get.
For instance, the dependency source_gen. The latest version of source_gen is clearly 0.5.0+1. So I'll setup my pubspec.yaml file as follows:
dependencies:
source_gen: "^0.5.0+1"
Then I run pub get, and I get the following error:
Resolving dependencies...
Package source_gen has no versions that match >=0.5.0+1 <0.6.0 derived from:
- ServerErrors depends on version ^0.5.0+1
I tried several of the most recent versions, without much luck. Finally if I do the following:
dependencies:
source_gen: any
and then run pub get, source_gen version 0.4.7 is installed. I'm not sure I understand why. I'm using the dart sdk version 1.16.0. This is the second dependency I've had this issue with and I'm a little confused.
EDIT: As requested by Gunter, the full list of my dependencies:
dependencies:
http: "^0.11.3+7"
dartson: "^0.2.5"
intl: "^0.12.7+1"
mailer: "^1.0.0"
That's a known issue of pub. This means pub just wasn't able to resolve a compatible set of dependencies. Unfortunately the error message is misleading.
pub also prints the same error when one of the dependencies isn't compatible with the used Dart SDK version.

Dart editor can't retrieve dependencies with Pub

I am trying to retrieve the needed dependencies for my newest project that I was going to try out Angular Dart with but every time I try to retrieve the dependencies like angular and web components packages, I get and error. The message in the editor console is:
"Pub get failed, [69] Resolving dependencies...
Connection closed before full header was received
** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **"
I did run it again a few times to see if that would fix it and it did not, it only made the same message again.
I am using dart sdk version 1.9.1 with dart editor build 44672
I have already tried pub cache repair on the cmd and it didn't help.
This is my pubspec.yaml file:
name: angulardart
version: 0.0.1
description: An absolute bare-bones web app.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
angular: '1.1.0'
browser: '>=0.10.0+2 <0.11.0'
web_components: '>=0.10.0+2 <0.11.0'
transformers:
angular
Anything would be helpful.
Edit
I have tried running pub get --trace and it did not work
I have also tried removing the constraints and running just any version of my dependencies. It still returns the same warning and issue:
"Pub get failed, [69] Resolving dependencies...
Connection closed before full header was received
** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **"
My pubspec.yaml for this try is:
name: angulardart
version: 0.0.1
description: An absolute bare-bones web app.
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
angular: any
browser: any
web_components: any
transformer:
angular
The issues seems to be an error in the latest build of dart sdk 1.9.1 and I have submitted an issue with the developers in google code.
issue link: http://dartbug.com/23004

Pub warnings while trying to run bwu_datagrid 0.0.18 and polymer+angular

I'm trying to create a simple project with the latest versions of polymer, angular, and bwu_datagrid 0.0.18. I can't get pass the pub get, I get a warning and pub never downloads bwu_datagrid. I need help getting these 3 gems to work in symphony.
pubspec.yaml:
name: angu_poly
description: A sample web application
dependencies:
angular: any
polymer: any
bwu_datagrid: "0.0.18"
This is the warning I get:
Pub get failed, [1] Resolving dependencies...
Incompatible version constraints on barback:
- polymer 0.10.0-pre.0 depends on version >=0.9.0 <0.13.0
- pub itself depends on version >=0.13.0 <0.15.3
** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **
Just in case, I'm on the latest dart editor/sdk:
Dart Editor version 1.7.2.release (STABLE)
Dart SDK version 1.7.2
Add a specific version constraint to you pubspec.yaml.
dependencies:
polymer: '>=0.15.1 <0.16.0'
This might lead to follow up errors. Continue accordingly for similar errors.
As last resort you can add dependency overrides to force a package no matter if it fulfills the constraints defined in the other imported packages (use at your own risk though).
dependency_overrides:
some_package: '=>1.0.0 <1.1.1'

Dart pub is not downloading dependencies

I had moved my Dart Project to another folder, with the same folder structure, however, now, I'm receiving the following message:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Could not find package "dartflash 0.6.3" at http://pub.dartlang.org.
Here is my pubspec.yaml:
name: Chronium
description: A framework for doing Chrono like games.
dependencies:
dartflash: 0.6.3
And pubspec.lock:
{"packages":{"dartflash":{"version":"0.6.3","source":"hosted","description":"dartflash"}}}
And the file structure:
The website (http://pub.dartlang.org/) is accessible from the browser.
I'm on dart (Dart Editor version 0.2.9_r16323). Do someone knows what is happening?
According to Seth Ladd post, this should be fixed now :
If you were having troubles with pub.dartlang.org, we're happy to report that we've fixed the issue. Many apologies for the temporary downtime. Looks like it was an issue with the server pointing to the wrong data store. Thanks for all the reports, the pub is open again!

Is there a workaround for pub dependency resolution through proxies?

I'm trying to play with https://github.com/dart-lang/web-ui-code-lab for dart development. If I follow the pdf and open step05, then try to run chat_server.dart, I get this error (my path has no spaces in it, in case that's relevant):
dart --enable-checked-mode bin/chat_server.dart
Unable to open file: path/to/web-ui-code-lab-master/step05/bin/packages/dart_chat/file_logger.dart'file:///path/to/dart/web-ui-code-lab-master/step05/bin/chat_server.dart': Error: line 5 pos 1: library handler failed
import 'package:dart_chat/file_logger.dart' as log;
^
I presume this means that there are some missing dependencies, but I can't run pub install because I'm behind a corporate http proxy:
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "web_ui 0.2.8+6" at http://pub.dartlang.org.
Hence, I started looking for a temporary workaround for pub dependency resolution. I tried changing the pubspec.yaml to go through the git:// protocol instead of http (which won't resolve without going through the proxy):
name: dart_chat
description: This is a chat app written in Dart using the Dart Web UI package
dependencies:
web_ui:
git: git://github.com/dart-lang/web-ui.git
I get further than before with pub install, so I think it successfully went through the git protocol and is trying to resolve web_ui's dependencies, but unfortunately doing so fails on web_ui's dependency for logging (which looks like it's still going through http://):
Running pub install ...
Pub install failed, [1] Resolving dependencies...
Timed out trying to find package "logging 0.2.7" at http://pub.dartlang.org.
It looks like I can't change the yaml to use the sdk's logging dependency either:
logging:
sdk: logging
because that's an incompatible source with web_ui:
Pub install failed, [1] Resolving dependencies...
Incompatible dependencies on 'logging':
- 'dart_chat' depends on it from source 'sdk'
- 'web_ui' depends on it from source 'hosted'
Is there any other way to get around this proxy issue with the current dev tools? Could I mirror pub.dartlang.org somehow? Or mirror the git repositories for each dependency? Thanks.
You said that you're using a Mac. If it's a laptop, why don't you try doing it from home? I'll notify the author of pub about this issue to see if he has any suggestions.
Currently there is no way to set a proxy in the Dart Editor, you can star this issue to check when it will be available.
I found a workaround to run the Pub install/update behind a proxy: in Windows, you can acess the "Environment variables" and add a variable named HTTP_PROXY with the value
https://USER:PASSWORD#my.proxy.adress:PORT

Resources