firebase - Flutter 应用因 dart.html 而停止工作
问题描述
我正在开发flutter应用程序并向其添加firebase 在我停止调试会话并重新启动它后,该应用程序工作正常,错误开始出现..flutter doctor 不返回任何错误。我试图振作起来,但它是无效 的所有与 firebase 相关的代码
import 'dart:io';
import 'package:circles/Services/storage.dart';
import 'package:circles/models/user-model.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
class AuthService {
/// This Class will handle all the process related to the auth and account including:
/// - the process of saving the user data to the cloud
/// - Uploading the User Images will start from this class
/// - Starting the app will run currentUser() to check if there is a user recorded locally in the device
static FirebaseAuth _auth = FirebaseAuth.instance;
static Firestore _firestore = Firestore.instance;
static Future<FirebaseUser> currentUser() async {
assert(_auth != null);
FirebaseUser currentUser = await _auth.currentUser();
return currentUser;
}
static Future<FirebaseUser> signIn(String email, String password) async {
assert(_auth != null);
AuthResult result = await _auth.signInWithEmailAndPassword(
email: email.trim(), password: password.trim());
assert(result != null);
FirebaseUser currentUser = result.user;
return currentUser;
}
static Future<FirebaseUser> signUp(String email, String password) async {
// Create a new User with Email/Password
assert(_auth != null);
AuthResult result = await _auth.createUserWithEmailAndPassword(
email: email, password: password);
assert(result != null);
FirebaseUser currentUser = result.user;
return currentUser;
}
static bool sendUserForgetPasswordEmail(String email) {
// Return a bool to return the user email request is completed or not
bool isCompleted = false;
_auth.sendPasswordResetEmail(email: email.trim()).whenComplete(() {
isCompleted = true;
});
return isCompleted;
}
// Save and Retrive the User data funcs will be defined here is it related to the user
// Two Main Funcs: save/fetch
// Updating data func will be defined here also and updating data that related
//to circles as it will be connected to the user himself
static Future<void> saveUserProfileData(User user, File imageFile) async {
user.imageUrl = Storage.uploadUserImage(imageFile) as String;
// Create a new doc with id :(_auth.currentUser().then((user) => user.uid));
// Save the User data in Map format in the doc and The Personal Image will be stored in the storage
_firestore
.collection("USERS")
.document(await _auth.currentUser().then((user) => user.uid))
.setData(user.toMap());
}
static Future<User> fetchUserProfileData() async {
// Get the currentUser Data by its uid and return User() with all the data
return _firestore
.collection("USERS")
.document(await _auth.currentUser().then((value) => value.uid))
.get()
.then<dynamic>((DocumentSnapshot snapshot) {
if (snapshot.data.isNotEmpty)
return User.mapToUser(snapshot.data);
else
return null;
});
}
}
Pubspec.yaml 依赖项
cupertino_icons: ^0.1.3
firebase_auth: ^0.14.0+5
cloud_firestore: ^0.12.9+4
firebase_storage: ^3.0.4
location: ^3.0.2
minSdkVersion 23
错误
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/top_level.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
^
/C:/src/flutter/packages/flutter/lib/src/foundation/_platform_web.dart:5:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.2/lib/js.dart:8:1: Error: Not found: 'dart:js'
export 'dart:js' show allowInterop, allowInteropCaptureThis;
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.2/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util'
export 'dart:js_util';
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart:306:25: Error: The method 'allowInterop' isn't defined
for the class 'Auth'.
- 'Auth' is from 'package:firebase/src/auth.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart').Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var nextWrapper = allowInterop((firebase_interop.UserJsImpl user) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart:310:26: Error: The method 'allowInterop' isn't defined
for the class 'Auth'.
- 'Auth' is from 'package:firebase/src/auth.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart').Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var errorWrapper = allowInterop((e) => _changeController.addError(e));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart:340:25: Error: The method 'allowInterop' isn't defined
for the class 'Auth'.
- 'Auth' is from 'package:firebase/src/auth.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart').Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var nextWrapper = allowInterop((firebase_interop.UserJsImpl user) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart:345:11: Error: The method 'allowInterop' isn't defined
for the class 'Auth'.
- 'Auth' is from 'package:firebase/src/auth.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/auth.dart').Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((e) => _idTokenChangedController.addError(e));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart:164:9: Error: The method 'allowInterop' isn't defined for the class 'DatabaseReference<T>'.
- 'DatabaseReference' is from 'package:firebase/src/database.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((update) => jsify(transactionUpdate(dartify(update))));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart:166:26: Error: The method 'allowInterop' isn't defined for the class 'DatabaseReference<T>'.
- 'DatabaseReference' is from 'package:firebase/src/database.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var onCompleteWrap = allowInterop(
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart:301:24: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
- 'Query' is from 'package:firebase/src/database.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var callbackWrap = allowInterop((database_interop.DataSnapshotJsImpl data,
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart:325:30: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
- 'Query' is from 'package:firebase/src/database.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
jsObject.once(eventType, allowInterop(
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart:402:22: Error: The method 'allowInterop' isn't defined for the class 'DataSnapshot'.
- 'DataSnapshot' is from 'package:firebase/src/database.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var actionWrap = allowInterop((d) => action(DataSnapshot.getInstance(d)));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart:72:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
- 'Messaging' is from 'package:firebase/src/messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
final nextWrapper = allowInterop((payload) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart:75:28: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
- 'Messaging' is from 'package:firebase/src/messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
final errorWrapper = allowInterop((e) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart:87:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
- 'Messaging' is from 'package:firebase/src/messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
final nextWrapper = allowInterop((payload) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart:97:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
- 'Messaging' is from 'package:firebase/src/messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
final nextWrapper = allowInterop((_) => null);
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart:98:28: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
- 'Messaging' is from 'package:firebase/src/messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
final errorWrapper = allowInterop((e) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart:317:11: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
- 'UploadTask' is from 'package:firebase/src/storage.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((storage_interop.UploadTaskSnapshotJsImpl data) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart:321:26: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
- 'UploadTask' is from 'package:firebase/src/storage.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var errorWrapper = allowInterop((e) => _changeController.addError(e));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart:322:26: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
- 'UploadTask' is from 'package:firebase/src/storage.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var onCompletion = allowInterop(() => _changeController.close());
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/top_level.dart:194:7: Error: Method not found: 'hasProperty'.
if (js.hasProperty(error, 'message')) {
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/top_level.dart:195:19: Error: Method not found: 'getProperty'.
var message = js.getProperty(error, 'message');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:29:7: Error: Method not found: 'hasProperty'.
if (util.hasProperty(jsObject, 'firestore') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:30:7: Error: Method not found: 'hasProperty'.
util.hasProperty(jsObject, 'id') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:31:7: Error: Method not found: 'hasProperty'.
util.hasProperty(jsObject, 'parent')) {
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:37:7: Error: Method not found: 'hasProperty'.
if (util.hasProperty(jsObject, 'latitude') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:38:7: Error: Method not found: 'hasProperty'.
util.hasProperty(jsObject, 'longitude') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:44:15: Error: Method not found: 'getProperty'.
var proto = util.getProperty(jsObject, '__proto__');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:46:7: Error: Method not found: 'hasProperty'.
if (util.hasProperty(proto, 'toDate') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:47:7: Error: Method not found: 'hasProperty'.
util.hasProperty(proto, 'toMillis')) {
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:52:7: Error: Method not found: 'hasProperty'.
if (util.hasProperty(proto, 'isEqual') &&
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:53:7: Error: Method not found: 'hasProperty'.
util.hasProperty(proto, 'toBase64')) {
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:67:24: Error: Method not found: 'getProperty'.
map[key] = dartify(util.getProperty(jsObject, key));
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:91:17: Error: Method not found: 'newObject'.
var jsMap = util.newObject();
^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:93:7: Error: Method not found: 'setProperty'.
util.setProperty(jsMap, key, jsify(value));
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:116:12: Error: Method not found: 'allowInterop'.
return allowInterop(dartObject);
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:124:5: Error: Method not found: 'callMethod'.
util.callMethod(jsObject, method, args);
^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:139:19: Error: Method not found: 'promiseToFuture'.
value = await util.promiseToFuture(thenable);
^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:141:9: Error: Method not found: 'hasProperty'.
if (util.hasProperty(e, 'code')) {
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:152:27: Error: Method not found: 'allowInterop'.
return PromiseJsImpl<S>(allowInterop((
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:165:5: Error: Method not found: 'allowInterop'.
allowInterop(c.completeError);
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:173:22: Error: Method not found: 'getProperty'.
String get code => util.getProperty(_source, 'code');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:176:25: Error: Method not found: 'getProperty'.
String get message => util.getProperty(_source, 'message');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:179:22: Error: Method not found: 'getProperty'.
String get name => util.getProperty(_source, 'name');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:182:32: Error: Method not found: 'getProperty'.
Object get serverResponse => util.getProperty(_source, 'serverResponse');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/utils.dart:185:23: Error: Method not found: 'getProperty'.
String get stack => util.getProperty(_source, 'stack');
^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:105:30: Error: The method 'allowInterop' isn't defined for the class 'Firestore'.
- 'Firestore' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var updateFunctionWrap = allowInterop((transaction) =>
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:306:11: Error: The method 'allowInterop' isn't defined for the class 'DocumentReference'.
- 'DocumentReference' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((firestore_interop.DocumentSnapshotJsImpl snapshot) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:310:26: Error: The method 'allowInterop' isn't defined for the class 'DocumentReference'.
- 'DocumentReference' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var errorWrapper = allowInterop((e) => controller.addError(e));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:445:9: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
- 'Query' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((firestore_interop.QuerySnapshotJsImpl snapshot) {
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:449:24: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
- 'Query' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
var errorWrapper = allowInterop((e) => controller.addError(e));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart:775:9: Error: The method 'allowInterop' isn't defined for the class 'QuerySnapshot'.
- 'QuerySnapshot' is from 'package:firebase/src/firestore.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
allowInterop((s) => callback(DocumentSnapshot.getInstance(s)));
^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.3.0/lib/src/interop/js_interop.dart:17:7: Error: Method not found: 'hasProperty'.
if (util.hasProperty(jsObject, 'toDateString')) {
^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/_platform_web.dart:20:41: Error: Getter not found: 'window'.
final String navigatorPlatform = html.window.navigator.platform?.toLowerCase() ?? '';
^^^^^^
/C:/src/flutter/packages/flutter/lib/src/foundation/_platform_web.dart:40:12: Error: Getter not found: 'window'.
if (html.window.matchMedia('only screen and (pointer: fine)').matches) {
^^^^^^
/C:/src/flutter/packages/flutter/lib/src/painting/_network_image_web.dart:91:12: Error: Method not found: 'webOnlyInstantiateImageCodecFromUrl'.
return ui.webOnlyInstantiateImageCodecFromUrl(resolved, // ignore: undefined_function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dar
t%3Ahtm
l; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1 asFileUri (package:vm/kernel_front_end.dart:657:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:825:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:572:15)
<asynchronous suspension>
#4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:43:22)
#5 starter (package:flutter_frontend_server/server.dart:182:27)
#6 main (file:///C:/b/s/w/i
r/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:9:30)
#7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8 _RawRece
ivePortImpl._
handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 897
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\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
我找到了一个说删除package:firebase/firestore.dart
但我没有使用它的解决方案
解决方案
就我而言,我不小心导入了:'package:firebase/firestore.dart'; 而不是“包:cloud_firestore/cloud_firestore.dart”;
推荐阅读
- php - 将嵌套数字添加到数组中的分组总数
- loops - if 语句后循环不会继续
- python - Jupyter 无论如何都会产生 500 错误(新的和现有的笔记本)
- ios - AVAssetWriter:在调用`finishWriting`之前预览录制的.mp4?
- php - 如何用php获取非拉丁字符串的第一个字母
- javascript - React 中的多个复选框过滤
- google-apps-script - 当您打开以前的执行时,新 GAS 工作区会关闭代码(选项卡或窗口)。两者都看不到
- amazon-web-services - 无法在 AWS EC2 实例上运行 mongoexport
- r - R webscraping,不确定如何进行
- python - 从字符串数组转换为 num 数组时出现 ValueError,使用命令参数时文字无效?