Angular Dart Import Error With Tracing.dart - dart

I am using Angular Dart for a project. In my pubspec.yaml I have
dependencies:
browser: any
angular: "^1.1.2+2"
shadow_dom: any
json_object: any
bootjack: any
crypto: any
xml: "^2.3.2"
transformers:
- angular
for my dependencies. When I run my program in Dartium I get the error
The requested built-in library is not available on Dartium.'package:angular/tracing.dart': error: line 9 pos 1: library handler failed
import "dart:developer";
^: package:angular/tracing.dart
I never reference or use anything out of the tracing.dart so I'm not sure why this is causing an error.

The tracing package is directly using dart:profiler, which was deprecated and now removed. You can now use dart:developer instead, both libraries are compatible.
I would suggest to fork the package, replace dart:profiler with dart:developer (no other changes are required) and send a pull request. I already forked and fixed the package some time ago here, but I think the original package is inactive so I didn't created an PR. You can use my fork by adding this to your pubspec.yaml:
dependency_overrides:
tracing:
git: https://github.com/Fox32/tracing.dart.git

dart:profiler was recently renamed to dart:developer. One of your dependencies probably use an analyzer version that doesn't fit to your Dart version.
See also https://github.com/dart-lang/pub/issues/1345

Related

error: Target of URI doesn't exist: 'package:test/test.dart'

Since the latest flutter update my tests are broken.
It looks like the Dart test framework isn't available anymore:
error: Target of URI doesn't exist: 'package:test/test.dart'.
If you've upgraded to a recent master, you'll find that flutter_test has removed its dependency on package:test. The package hasn't been removed or renamed, but you will need to specifically add it to you dev_dependencies in your pubspec now:
dev_dependencies:
test: ^1.5.1
The test_api package is just used to unify the versioning and reduce the depencies of flutter_test. It didn't replace package:test. There are also no breaking changes in any of these newer test versions.
The problem for me targeted URI doesn't exist was due to lib folder inside test package was not available at
file:///E:/APPS/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/dartz-0.9.2/lib/
so I downloaded it from GitHub and add it there manually and restarted the IDE. And It worked.

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.

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'

fileSystem.chooseEntry from package:chrome/app.dart generates runtime error

Has anyone successfully used any fileSystem calls in package:chrome/app.dart? (This is the Chrome API package for Google Dart.)
Here's my code:
import 'package:chrome/app.dart';
void main() {
fileSystem.chooseEntry();
}
Here's my pubspec.yaml file:
name: ChooseEntry
description: A sample chrome packaged application
dependencies:
browser: any
chrome: any
meta: any
The other files were generated automatically by the Dart Editor and remain untouched by me.
The error I get from Dartium is:
Breaking on exception: 'package:chrome/src/common.dart': malformed type: line 72 pos 29: type 'js.Callback' is not loaded
When I compile to JS and run in Dartium or Chrome, I get this error:
Uncaught RuntimeError: Error: Cannot resolve 'Callback'.
So, my question is whether anyone has successfully used the chooseEntry API, or any API in fileSystem and, if so, what about what I did needs to be fixed. My guess is that I'm missing a package, but I can't identify what it might be.
I did add package "js" to pubspec.yaml, with no effect. I also tried making copies of all the packages, in case Dartium or Chrome didn't handle the symlinks correctly, and that didn't help either. (I doubt that that's the problem, as it found the code for fileSystem.chooseEntry just fine.)
I'm using:
Dart Editor version 1.0.0_r30798 (STABLE)
Dart SDK version 1.0.0.10_r30798
The chrome package appears not to be maintained anymore, consider using chrome_gen instead by replacing chrome with chrome_gen in pubspec.yaml and by editing the import statement like this:
import 'package:chrome_gen/chrome_app.dart';
main() {
fileSystem.chooseEntry();
}
The difference between these two packages is that wrappers are hand-written in chrome and autogenerated in chrome_gen from the json and idl files from Chrome.
Links:
Pub Package: chrome_gen
Mailing List: What is the difference between chrome and chrome_gen ?

pubspec.yaml deprecated layout

Here is my pubspec.yaml.
name: oct
version: 0.1.0
description: >
Ojus Chemistry Toolkit (OCT) is an open-source toolkit for solving a
variety of cheminformatics problems. It is developed in Dart, mostly.
dependencies:
args:
sdk: args
When I run pub install, I receive a warning as follows.
Warning: Package "oct" is using a deprecated layout.
Reading pub's package layout details, I have not yet understood what is triggering the above warning. Request help! Thanks!
Most likely, you have some .dart files outside predefined directories:
lib
web
test
New SDK gives a helpful link if this problem occurs: http://www.dartlang.org/docs/pub-package-manager/package-layout.html
Lesiak is mostly right. You'll get this warning if pub finds any .dart files in your package's root directory. In the old layout, that was where you put your publicly importable files.
In the new layout, those should go under lib.

Resources