Can't load Kernel binary (Dart SDK dev.69.4) - dart

I’m so sorry, but ... this time too I have a problem after updating the Dart SDK.
My pubspec.yaml file is:
environment:
sdk: '>=2.0.0-dev.69.4 <2.0.0'
dependencies:
sass_builder: ^2.1.1
angular: ^5.0.0-beta+2
angular_components: ^0.9.0-beta+2
angular_forms: ^2.0.0-beta+2
angular_router: ^2.0.0-alpha+17
js: ^0.6.1+1
path: ^1.6.2
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
test: ^1.3.0
I runned pub global activate webdev and pub upgrade commands. After this, I runned webdev serve, but I received the following error message:
Can't load Kernel binary: File size is too small to a valid kernel file.
webdev failed with an unexpected exception.
Unable to spawn isolate: Error while initializing Kernel isolate
How can I solve this issue?
It is likely that for the next update I will wait for the stable version of the Dart SDK.

I have the same problem, you can use "pub run build_runner serve" as workaround.

Related

Problems with webdev serve

I created a new project with the command:
dart create simple -t web-simple
and tried to run it:
webdev serve
pubspec.yaml is:
name: simple
description: An absolute bare-bones web app.
version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.16.1 <3.0.0'
# dependencies:
# path: ^1.7.0
dev_dependencies:
build_runner: ^2.1.4
build_web_compilers: ^3.2.1
lints: ^1.0.0
It crashes with a huge trace ending with:
[SEVERE] package:shelf/shelf_io.dart 139:5 handleRequest
An other up-to-date project using a build.yaml serves with errors:
[SEVERE] HttpException: Content size below specified contentLength. 3977 bytes written but expected 3978., uri = /web/
Is it a bug?

webdev serve doesn't work for basic AngularDart project

My Dart SDK version is 2.10.1 (installed through Chocolatey)
AngularDart version 6.0.0-alpha (as given by the pubspec.yaml)
I am using Windows
I am using Microsoft Edge for my browser
I use stagehand to create my projects
As said above I used stagehand web-angular command to create an AngularDart project. It was an empty project which I had not modified after creation. I tried to use the webdev serve command in my PowerShell to run my project. I opened the link given in the output but it was taking FOREVER to load. The output was:-
[INFO] Building new asset graph completed, took 4.7s
[INFO] Checking for unexpected pre-existing outputs. completed, took 3ms
[INFO] Serving `web` on http://<ip_address here>:8080
[INFO] Generating SDK summary completed, took 8.1s
[INFO] 37.1s elapsed, 499/520 actions completed.
The numbers in the last [INFO] block started to grow uptil 4532/4800 after which I lost my patience and terminated the command. I have even tried reinstalling Dart but it hasn't worked. It didn't work even when I ran pub get and tried to serve it again. How to fix this?
Try the following pubspec.yaml with your project.
name: my_app
description: A web app that uses AngularDart Components
version: 1.0.0
environment:
sdk: ">=2.2.0 <3.0.0"
dependencies:
angular: ^6.0.0
angular_components: ^1.0.1
angular_router: ^2.0.0
angular_forms: ^3.0.0
dev_dependencies:
angular_test: ^3.0.0
build_runner: ^1.10.2
build_test: ^1.2.2
build_web_compilers: ^2.12.0-dev.3
#build_web_compilers: ^2.12.2
test: ^1.15.4
sass_builder: ^2.1.3

Dart Webdev Dev Compiler not running since upgrade to 2.3.2

Since I have moved from Dart 2.1.0 to 2.3.2 "webdev serve" runs successfully, but when I run the project, it gets a 404 on "main.digests". I updated my dev dependencies of build_runner, build_web_compiler, and webdev to the latest versions, and the issue still occurs.
It still builds in dart2js fine. Even if it is "webdev serve --release" it works.
Here is a copy of my pubspec:
environment:
sdk: '>=2.3.2 <3.0.0'
dependencies:
analyzer: any
intl: any
stagexl: 1.4.0+2
stagexl_particle: ^0.4.0
uuid: ^1.0.3
dependency_overrides:
stagexl:
git: https://github.com/AndrewLugg/StageXL.git
dev_dependencies:
build_runner: ^1.6.1
build_web_compilers: ^2.1.1
webdev: ^2.2.0
and here is my build.yaml
targets:
$default:
builders:
build_web_compilers|entrypoint:
generate_for:
- web/app/**.dart
options:
dart2js_args:
- --fast-startup
- --no-source-maps
- --show-package-warnings
- --trust-primitives
- --trust-type-annotations
- --omit-implicit-checks
Here is a copy of the error:
http://localhost:53322/webdev/src/serve/injected/client.js:2693
GET http://localhost:53322/app/main.digests 404 (Not Found)
Uncaught Instance of 'minified:b0' client.js:367
Any help would be greatly appreciated.
This problem disappeared once we upgraded to Dart SDK 2.5.2, there was no real explanation to why this happened.

Webdev failed with an unexpected exception (Dart SDK 2.0.0-dev.69.1)

I have updated Dart SDK to 2.0.0-dev.69.1 version.
Also, I hace updated my pubspec.yaml file to this:
environment:
sdk: '>=2.0.0-dev.69.1 <2.0.0'
dependencies:
sass_builder: ^2.1.1
angular: ^5.0.0-beta+2
angular_components: ^0.9.0-beta
angular_forms: ^2.0.0-beta+2
angular_router: ^2.0.0-alpha+17
js: ^0.6.1+1
path: ^1.6.2
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
test: ^1.3.0
I run the command pub global activate webdev.
⚠ After these steps, I tried to run webdev serve command. I receive this error message:
webdev failed with an unexpected exception.
Unable to spawn isolate: file:///C:/Users/marco/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.32.3/lib/src/dart/analysis/library_context.dart:96:34: Error: Can't return a value from a void function.
return appendLibraryFiles(targetLibrary);
^
❔ Did you also find the same problem? How can I solve this problem?
Thanks!
There is an issue with SDK 2.0.0-dev.69.1 -- see this announcement. I'm not sure if it is related, but you might need to wait for the next release of the SDK, or downgrade to 2.0.0-dev.69.0.

Error after running "flutter upgrade"

I am getting the following error after running flutter upgrade:
Because every version of flutter_test from sdk depends on path 1.5.1 and flutter_advanced_networkimage >=0.2.9+1 depends on path ^1.6.0, flutter_test from sdk is incompatible with flutter_advanced_networkimage >=0.2.9+1.
So, because testapp depends on both flutter_advanced_networkimage ^0.2.10 and flutter_test any from sdk, version solving failed.
pub upgrade failed (1)
My pubspec.yaml:
name: testapp
description: A new Flutter application.
dependencies:
flutter:
sdk: flutter
device_info: "^0.2.0"
shared_preferences: "^0.4.1"
flutter_parallax: "^0.1.1"
cached_network_image: "^0.4.1"
connectivity: "^0.3.1"
chewie: "^0.6.0"
flutter_statusbarcolor: "^0.0.3"
fluro: "^1.3.1"
carousel_slider: "^0.0.4"
flutter_advanced_networkimage: "^0.2.10"
flutter_sticky_header: "^0.3.0"
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
I'm trying to get it working for hours, please help
I assume you are using the beta channel.
I think this doesn't happen in dev channel.
To switch to the dev channel run in a command line shell
flutter channel dev
flutter doctor
and try again.
I've had similar problems. My problem like this:
Because every version of flutter_test from sdk depends on http 0.12.0
and flutter_cache_manager 0.1.2 depends on http ^0.11.3+14,
flutter_test from sdk is incompatible with flutter_cache_manager
0.1.2. And because no versions of flutter_cache_manager match >0.1.2 <0.2.0, flutter_test from sdk is incompatible with
flutter_cache_manager ^0.1.2.
Here's how I solved it:
dependencies:
...
dependency_overrides:
http: ^0.12.0
so, I thank you can try it:
dependencies:
...
dependency_overrides:
path: ^1.6.0

Resources