Ошибка выброса флаттера при отладке - Сообщение компилятора: lib / views / signUp.dart: 1: 8: Ошибка: не найдено: 'dart: html' import 'dart: html'; - PullRequest
0 голосов
/ 19 июня 2020

Flutter версии 1.17.4 Я работаю над Ma c с macOS 10.15.5 , используя Android Studio 4.0

Android Studio 4.0 Build # AI-193.6911.18.40.6514223, построено 20 мая 2020 г.

Кодирование шло гладко, и эта ошибка возникла во время отладки после того, как я ввел следующую строку кода.

signMeUp() {
    if (formKey.currentState.validate()) {
      setState(() {
        isLoading = true;
      });
      authMethods.signUpWithEmailAndPassword(
          emailTextEditingController.text, passwordTextEditingController.text);
    }

и текущая ошибка приведена ниже. Я обращаюсь за помощью к кому-нибудь еще, это мой первый трепет, и у меня все не получается.

Launching lib/main.dart on Lenovo TB3 850M in debug mode...
Running Gradle task 'assembleDebug'...

Compiler message:
lib/views/signUp.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
       ^
../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';
       ^
../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;
^
../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';
^
../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' ('../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) {
                        ^^^^^^^^^^^^
../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' ('../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));
                         ^^^^^^^^^^^^
../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' ('../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) {
                        ^^^^^^^^^^^^
../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' ('../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));
          ^^^^^^^^^^^^
../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' ('../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))));
        ^^^^^^^^^^^^
../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' ('../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(
                         ^^^^^^^^^^^^
../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' ('../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,
                       ^^^^^^^^^^^^
../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' ('../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(
                             ^^^^^^^^^^^^
      ^^^^^^^^^^^
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:33:7)
#1      asFileUri (package:vm/kernel_front_end.dart:567:37)
#2      writeDepfile (package:vm/kernel_front_end.dart:760:21)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:539:15)
<asynchronous suspension>
#4      _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:40:22)
#5      starter (package:flutter_frontend_server/server.dart:178:27)
#6      main (file:///b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:8:30)
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script '/Users/MAVERICK/AndroidStudioProjects/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 882

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/MAVERICK/AndroidStudioProjects/flutter/bin/flutter'' 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 3m 38s
Exception: Gradle task assembleDebug failed with exit code 1
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...