Executing a dart application prints errors to console - dart

I am using Dart Editor|
Dart Editor version 1.10.0.dev_01_01 (DEV)
Dart SDK version 1.10.0-dev.1.1
I open polymer_snippet and run the app and it executes as expected.
I attempted to run epimss_app but it does not run and displays the following errors to Tools Ouput (console)
--- 1:20:06 PM Starting pub serve : polymer_snippet ---
Loading source assets...
The null object does not have a getter 'pubspec'.
NoSuchMethodError: method not found: 'pubspec'
Receiver: null
Arguments: []
dart:core Object.noSuchMethod
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\dependency_computer.dart 48 DependencyComputer.DependencyComputer.<fn>
dart:collection SetMixin.every
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\dependency_computer.dart 47 DependencyComputer.DependencyComputer
e:\b\build\slave\dart-editor-win-dev\build\dart\sdk\lib\_internal\pub\lib\src\barback\load_all_transformers.dart 33 loadAllTransformers.<async>
dart:isolate _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run
pub --trace 'serve' 'web' '--port' '8080' '--admin-port' '49923' '--hostname' 'localhost'
and include the results in a bug report on http://dartbug.com/new.
I tried to run polymer-snippet again with the same result. I closed Dart Editor did a pub cache repair and attempted running either application again with the same result.
The GUI (if dart-eclipse-editor is used) says Error Launching application - Could not start pub serve or connect to pub.
Why is this happening? I would expect to be able to change from one dart app to another and run either without any issues.
Thanks

Related

Flutter #dart=2.9 import 'dart:math'; Error, dart code won't run in emulator?

Question: How can I solve the flutter error as shown below & why does this happen?
What I can't understand out of this error, is
that I can't comprehend what #dart=2.9 is. I hadn't previously run or coded the file in a while. So, when I came back to work on this flutter file project, it threw me this error?
I tried updating flutter on the command prompt. Everything it's fine according to the flutter doctor. The only missing piece is just visual studio, but I use visual studio Code. So, I am assuming that's not the problem. If not, then what could it be? I am deeply thinking about this long error, that can't get to comprehend.
Much appreciation in advance any sort of help will be gratefully appreciated
Error: Flutter run -
When I run flutter run it always displays the errors below.
Invalid depfile: C:\Users\14706\Desktop\Test-SETUP\New folder\This_Folder_Contains_Map_Tests_From_Top_To_Bottom_Atempts\Challenge_1\flutter_login_auth\.dart_tool\flutter_build\6494cc4bb6a11f1a583790c79662ece5\kernel_snapshot.d
Invalid depfile: C:\Users\14706\Desktop\Test-SETUP\New folder\This_Folder_Contains_Map_Tests_From_Top_To_Bottom_Atempts\Challenge_1\flutter_login_auth\.dart_tool\flutter_build\6494cc4bb6a11f1a583790c79662ece5\kernel_snapshot.d
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/firebase_database.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
lib/Pages/auth/mainLoginCheck.dart:2:8: Error: Not found: 'dart:html'
import 'dart:html';
^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/utils/push_id_generator.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/database_reference.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/event.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/firebase_database.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/query.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_database-6.1.2/lib/src/on_disconnect.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
// #dart=2.9
^^^^^^^^^^^^
Unhandled exception, umm...???
what even is this error that comes along down here?
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart
%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)
#1 asFileUri (package:vm/kernel_front_end.dart:659:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:799:2
1)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:625:9)
<asynchronous suspension>
#4 starter
(package:frontend_server/frontend_server.dart:1451:12)
<asynchronous suspension>
#5 main (file:///C:/b/s/w/ir/x/w/sdk/pkg/frontend_server
/bin/
frontend_server_starter.dart:10:14)
<asynchronous suspension>
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\14706\Desktop\CODES\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\14706\Desktop\CODES\Flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
Running Gradle task 'assembleDebug'... 30.1s
Exception: Gradle task assembleDebug failed with exit code 1
Error: Not found: 'dart:html'
import 'dart:html';
I have previoulsy tried updating flutter on command prompt. Everything it's fine according to flutter doctor. I have tried looking on what #=dart=2.9 is? but not enought understanding still. I have also tried looking on something the error highlights which is 'dart:html'; still, I don't comprehend how and why that is an errors?
1-just delete import 'dart:html'; from your code
2-run flutter clean then flutter pub get
if that doesn't work check this

Built value generator fails

Since this morning, the generation step of built value (pub run build_runner build) is failing with
[SEVERE] built_value_generator:built_value on lib/client.dart (cached):
Unknown error in BuiltValueGenerator for myproject|lib/client.dart.
NoSuchMethodError: The method 'getParsedLibraryByElement' was called on null.
Receiver: null
Tried calling: getParsedLibraryByElement(Instance of 'LibraryElementImpl')
I tried upgrading to built value 6.6.0 (from 6.3.2), but it didn't help
Dart version is 2.1.0-dev.9.4
Any suggestions are welcome

After running CDE I can't build sample polymer app in dart editor

file:/C:/Users/Dave/dart/td2/build.dart
build.dart returned error code 255
Unhandled exception:
Uncaught Error: FileSystemException: Cannot open file, path = 'C:\Users\Dave\dart\td2\packages\args\args.dart' (OS Error: The system cannot find the file specified., errno = 2)
Stack Trace:
#0 _File.open.<anonymous closure> (dart:io/file_impl.dart:349)
#1 _RootZone.runUnary (dart:async/zone.dart:1151)
Dart editor was working fine with a polymer app that I was developing previously.
I have rebooted, reinstalled dart editor with no luck
Running Pub Get manually fails as well as it can't find files either. Evrrything was working prior to trying CDE and the designer.
I think running pub cache repair (run in command line interface) should be able to fix this.

Dart pub rename failed

I am using the Dart Editor and get the following error when I run pub get
--- Dec 11, 2013 9:21:42 PM Running pub get ... --- Pub get failed, [1] Resolving dependencies.......... Downloading json_object
1.0.18+2... Rename failed
** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **
What is going on here? I have downloaded many packages before.
How do I get a more meaningful error message?
Could be a problem with symlinks.
You may try to empty your packages directory within your package and also try to empty your .pub-cache directory.

Runnning the web components build.dart: FormatException: Could not find an option named "machine"

I'm getting this error whenever I update some file and the build.dart runs:
build.dart --changed=web\index.html
file:/C:/Users/Fernando/dart/ACIMReader/build.dart
build.dart returned error code 255
Unhandled exception:
FormatException: Could not find an option named "machine".
#0 ArgParser._validate (package:args/args.dart:349:21)
#1 ArgParser._parseLongOption (package:args/args.dart:488:16)
#2 ArgParser.parse (package:args/args.dart:313:27)
#3 _processArgs (package:web_components/component_build.dart:99:26)
#4 build (package:web_components/component_build.dart:34:26)
#5 main (file:///C:/Users/Fernando/dart/ACIMReader/build.dart:5:8)
The editor recently started adding a --machine flag so that build scripts would know to output machine readable messages. web_components added support for the flag last week, have you run pub update?

Resources