I'm trying to put paper elements in my angularDart app, so I have put in my pubspec.yaml the following dependencies:
dependencies:
angular: ">=1.0.0 <2.0.0"
paper_elements: ">=0.5.0 <0.6.0"
And then when I try to pub upgrade I get the following:
Pub: Upgrade Dependencies: Incompatible version constraints on
html5lib:
- angular 1.0.0 depends on version >=0.10.0 =0.11.0 <0.13.0
I'd really like to use the 1.0.0 (at least) version of angular Dart, however I was wondering if there was a way to satisfy both libs' dependencies. (and how does someone get to know what the correct dependencies' versions are)
Note that I tried doing the same with Polymer and facing the same problem (with a different dependency), so a general way of working around this would help, instead of just giving version numbers.
Just use dependency overrides.
dependency_overrides:
html5lib: 0.12.0
There is no way to satisfy both when their constraints have no common set.
It's at your own risk when one of them doesn't work properly with the specified version.
Related
I recently stumbled across Dart, and got pretty excited about it because it almost feels like that perfect language I've always been looking for. I work with PHP at my job (Yes, I know, ew gross) as a web developer and was excited to try and build a web app using the language. Figured it couldn't be too hard as that's what Dart was originally made for. Turns out it more difficult than I though, and I can't even get off the ground. I was hoping someone else could help point me in the right direction.
So, I really haven't done any real coding in this project at all. I literally downloaded the Dart SDK, used stagehand to create web-simple project, then I added a bin/server.dart file to the project. The code in that file was pretty much taken straight out of the online documentation for the mojito package:
import 'package:mojito/mojito.dart';
main() {
var app = init();
app.router
..addStaticAssetHandler('/static');
app.start();
}
I added the dependency mojito: "^0.6.6" to the pubspec.yaml file as well of course. That's all I've done though, like I say, I haven't even managed to get off the ground yet.
When I run server.dart I get the following error:
'package:convert/src/percent/encoder.dart': malformed type: line 23 pos 13: cannot resolve class 'ChunkedConverter' from 'PercentEncoder'
I get the exact same error message if I try to build a server with the shelf_rest package instead of the mojito package.
A search of that error message doesn't bring up too much helpful info, though I found one forum where someone recommended adding convert: ^2.0.1 to the dependencies. Apparently there was a change made in that package that causes incompatibility with other packages. I tried that suggestion but it doesn't seem to be resolving the issue.
I'm certain the issue is some sort of dependency issue, I'm probably using a mix of dependencies that I guess just aren't meshing right. If someone could help me figure out what I'm doing wrong it would be much appreciated. I want to learn and start using Dart but obviously I'm not having such great luck with it...
Here's what the pubspec.yaml looks like in case it helps:
environment:
sdk: '>=1.24.0 <2.0.0'
dependencies:
shelf: ^0.6.0
mojito: "^0.6.6"
convert: ^2.0.1
dev_dependencies:
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- dart_to_js_script_rewriter
The last version of mojito was uploaded in October 2016 and it seems abandoned. Since then, Dart has added Strong mode and begun transitioning to Dart 2. This included significant changes to the type system and updates to SDK libraries.
Additionally, transformers have also been removed - any documentation you find referencing them is out of date. And in this case, the dart2js script rewriter is for client side JavaScript, not servers.
If you're looking for Server libraries, I would recommend just starting with the latest version of Shelf
I am trying to use dart hangouts_api and polymer at the same time and I get the following error:
Incompatible version constraints on browser:
- hangouts_api 0.3.0 depends on version >=0.9.0 <0.10.0
- polymer 0.15.1 depends on version >=0.10.0 <0.11.0
Mu pubspec.yaml file refers to the current version of each.
I cannot use anything but the lastest version of each as the suggested alternatives are years old. Is there a work around? To whom should I report this to (assuming it is a bug)?
Just create an issue in the hangouts_api GitHub repo and ask to bring dependencies up to date or even better, create a pull request.
As a workaround you can force a specific version by adding
dependency_overrides:
browser:">=0.10.0“
see also https://www.dartlang.org/tools/pub/dependencies.html#dependency-overrides
I'm get this error with a angular 1.0.0 project and I don't know what this means and what should be done. I do not understand the explanation in link https://github.com/angular/di.dart/wiki/Uninitialized-Module.DEFAULT_REFLECTOR-error
My project declare one dependency in a library that declares a dependency in angular. So my project doesn't have a direct dependency in angular and I can't declare transformers in the pubspec.yaml file.
I got the same error when I was using main() async - so removing the async and going back to the conventional Future-base version was the solution.
I filed an issue report: https://github.com/angular/di.dart/issues/221
Angular now use static generated content. The html files for components are processed during pub install or pub serve
The pubspec.yaml file needs something like:
transformers:
- angular:
html_files:
- web/controllers/error_warning_controller.html
- web/controllers/http_interceptor_controller.html
- web/controllers/notify_tray_controller.html
- web/controllers/notify_desktop.html
- web/controllers/panel_controller.html
- web/controllers/window_controller.html
dart_sdk: /usr/local/opt/dart/libexec
Also it not work if you use a library that depends on angular you need a direct dependency for angular transform to work, I work around declaring the dependency twice, one for the library one for the project that use the library.
I have recently updated Elastic Search from 0.90.0 to 1.3.2 and now I'm getting a conflict with a Lucene version used by another dependency. The scenario look as follows:
jar A uses Lucene 4.9.0
jar B uses Lucene 3.3.0
The point is that I'm getting a java.lang.VerifyError because B code is overriding a final method of a Lucene's class which is not final at 4.9.0 version.
I've tried this with no success:
compile ('A')
compile ('B')
compile ('org.apache.lucene:lucene-core:4.9.0') {
excludes(B)
}
compile ('org.apache.lucene:lucene-analyzers-common:4.9.0') {
excludes(B)
}
I don't know what more to do, any clues on this?
Thanks!
Assuming you want the latest version of Lucene, your exclusions are actually backwards.
Your declaration of B should look something like this:
compile ('B') {
excludes "lucene-core", "lucene-analyzers-common"
}
Include any other lucene jars that might conflict in that list as well.
If you aren't specifically utilizing any lucene libraries (aside from the elasticsearch plugin) in your code, you can remove the explicit Lucene declarations.
I don't know enough about Lucene to tell you whether 4.9.0 is backwards compatible with 3.3.0, but this solution should at least make sure that 4.9.0 is what is on your project's classpath, and not 3.3.0
I'm installing and configuring Polymer and i get to this:
Unable to find a suitable version for polymer, please choose one:
1) polymer#master which resolved to ced408df76 and is required by core-component-page#a431519835, highlightjs-element#a2c5fc08d0, marked-element#761922b4a2
2) polymer#0.2.4 which resolved to 0.2.4 and is required by core-ajax#0.2.4, core-bind#0.2.4, core-collapse#0.2.4, core-doc-viewer#0.2.4, core-elements#0.2.4, core-firebase#0.2.4, core-icon#0.2.4, core-icons#0.2.4, core-iconset#0.2.4, core-iconset-svg#0.2.4, core-input#0.2.4, core-layout#0.2.4, core-layout-grid#0.2.4, core-layout-trbl#0.2.4, core-list#0.2.4, core-localstorage#0.2.4, core-media-query#0.2.4, core-menu-button#0.2.4, core-meta#0.2.4, core-overlay#0.2.4, core-range#0.2.4, core-selection#0.2.4, core-selector#0.2.4, core-theme-aware#0.2.4, core-tooltip#0.2.4, core-transition#0.2.4
3) polymer#~0.2.4 which resolved to 0.2.4 and is required by project
Prefix the choice with ! to persist it to bower.json
I'm still learning about and i dont know which one i should choose and why this problem happend. Can anyone explain me this tree options?
Thanks..
The recommended way to install Polymer 0.2.4 is through Bower. We’ve
chosen Bower because it removes the hassle of dependency management
when developing or consuming elements.
from http://www.polymer-project.org/docs/start/getting-the-code.html
I'd go with
2) polymer#0.2.4 which resolved to 0.2.4 and is required by
...
This happened because when bower went to install a version of polymer it was presented with three options and didnt know which one to choose from. Many packages have a stable release and a development version, which you want is up to yourself. You can usually check up the packages on github or there websites to find which package might suit you best