Open siloebb opened 4 years ago
Did you use import 'package:intl/date_symbol_data_http_request.dart';
? I solved this error withimport 'package:intl/date_symbol_data_local.dart';
.
If you want to support both web and mobile then it may depend on another issue.
I've encounter the same issue and importing the right intl dart file fix it :) Thank you @jeiea
BTW, I think this issue may be closed
I tried all the above steps and still getting the error! What's going on!?
I decided to do the date formatting manually. I'm not recommending Fluttter/Dart to anyone!
This is ridiculous, out of the blue i'm getting this error now.. none of my dependencies have changed, using dart 2.14 and flutter 2.5.3, and I can resolve and import html in my project files so not sure what the begeezus is going on.
@devnullpointer , @premedios , could you add more details on the errors you are getting and if the above comment fixes them?
I don't remember what I was doing when I got that error.
Did a pub upgrade with the latest dart/flutter and dependencies and the issue cleared itself, must have been a combo of null-safety with no null safety libs interacting like a big conga line.
Thanks for the quick feedback on this old issue! I will close it then.
I had the same issue, one unwanted import was in my code. This import was the culprit "_import 'package:intl/date_symbol_data_httprequest.dart'". When I removed this import and got worked :)
Thanks for the tip! Was this recently/with a recent Flutter version?
Unfortunately, I still can't reproduce the error. Reopening though.
Did you use
import 'package:intl/date_symbol_data_http_request.dart';
? I solved this error withimport 'package:intl/date_symbol_data_local.dart';
.If you want to support both web and mobile then it may depend on another issue.
This should be in the docs.
不知道什么时候,我的main.dart里面多了这句import,导致我项目运行不起来,报错提示语同上,删除后问题就解决了。记录下
![]()
不知道什么时候,我的main.dart里面多了这句import,导致我项目运行不起来,报错提示语同上,删除后问题就解决了。记录下
开发平台ios&android
@539863010, running dart fix
should get rid of the unnecessary imports. That the "right" library has to be imported should be documented better.
I install the lib but when I try to run the app I got that error below. I think thar was I update the flutter to 1.17, I tried to clean the project and the cache.
`Launching lib/main.dart on SM N9600 in debug mode... Running Gradle task 'assembleDebug'...
Compiler message: ../../../.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/src/http_request_data_reader.dart:11:8: Error: Not found: 'dart:html' import 'dart:html'; ^ ../../../.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/src/http_request_data_reader.dart:28:10: Error: Type 'HttpRequest' not found. Future _getString(String url, HttpRequest xhr) {
^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/src/http_request_data_reader.dart:28:46: Error: Type 'HttpRequest' not found.
Future _getString(String url, HttpRequest xhr) {
^^^^^^^^^^^
Invalid depfile: /home/siloe/Developer/flutter/meditacao/.dart_tool/flutter_build/659e08df06b3af32a6baf6232e5f9259/kernel_snapshot.d
Invalid depfile: /home/siloe/Developer/flutter/meditacao/.dart_tool/flutter_build/659e08df06b3af32a6baf6232e5f9259/kernel_snapshot.d
Compiler message: ../../../.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/src/http_request_data_reader.dart:11:8: Error: Not found: 'dart:html' import 'dart:html'; ^ ../../../.pub-cache/hosted/pub.dartlang.org/intl-0.16.1/lib/src/http_request_data_reader.dart:20:19: Error: The method 'HttpRequest' isn't defined for the class 'HttpRequestDataReader'.
0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
dart-lang/i18n#352 asFileUri (package:vm/kernel_front_end.dart:567:37)
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null build failed.
FAILURE: Build failed with an exception.
Where: Script '/home/siloe/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 882
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
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 16s Exception: Gradle task assembleDebug failed with exit code 1`