首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >哪里出了问题:任务的执行失败了:app:compileFlutterBuildDebug‘。>

哪里出了问题:任务的执行失败了:app:compileFlutterBuildDebug‘。>
EN

Stack Overflow用户
提问于 2022-03-14 21:59:36
回答 1查看 568关注 0票数 2

应用程序工作了一整天,而我经常重建它,然后,一旦我试图再次构建它,我继续得到这些错误。我没有添加任何新的依赖项,也没有对代码进行任何重大更改。当谷歌搜索这些错误信息时,我可能尝试了所有你能找到的东西,但是没有什么帮助我。如果我试图将代码迁移到新项目,它将面临同样的问题。

正如错误信息所示,这个问题似乎与云防火墙有关,当我在我的应用程序中删除对它的所有引用时,只留下firebase就知道它构建得很好。调试控制台如下所示:

代码语言:javascript
运行
复制
Launching lib\main.dart on Android SDK built for x86 in debug mode... Invalid depfile: C:\FlutterProjects\table_tennis_app\.dart_tool\flutter_build\742478cdbb2672c05d106c6da3c117ec\kernel_snapshot.d Invalid depfile: C:\FlutterProjects\table_tennis_app\.dart_tool\flutter_build\742478cdbb2672c05d106c6da3c117ec\kernel_snapshot.d /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/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/firebase-9.0.2/lib/src/utils.dart:2:8: Error: Not found: 'dart:html'

import 'dart:html';
       ^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:2:8: Error: Not found: 'dart:html' import 'dart:html';
       ^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.3/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-9.0.2/lib/src/firestore.dart:102:32: 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-9.0.2/lib/src/firestore.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final updateFunctionWrap = allowInterop((transaction) =>

                               ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/firestore.dart:300:9: 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-9.0.2/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-9.0.2/lib/src/firestore.dart:304: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-9.0.2/lib/src/firestore.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final errorWrapper = allowInterop((e) => controller.addError(e));
                         ^^^^^^^^^^^^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/firestore.dart:441: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-9.0.2/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-9.0.2/lib/src/firestore.dart:445:26: 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-9.0.2/lib/src/firestore.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.

    final errorWrapper = allowInterop((e) => controller.addError(e));
                         ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/firestore.dart:761: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-9.0.2/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-9.0.2/lib/src/utils.dart:51:29: Error: Method not found: 'getProperty'.
    map[key] = dartify(util.getProperty(jsObject, key));
                            ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:73:24: Error: Method not found: 'newObject'.

    final jsMap = util.newObject();
                       ^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:75:12: Error: Method not found: 'setProperty'.
      util.setProperty(jsMap, key, jsify(value));

           ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:97:12: Error: Method not found: 'allowInterop'.
    return allowInterop(dartObject);

           ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:105:10: Error: Method not found: 'callMethod'.

    util.callMethod(jsObject, method, args);
         ^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:120:24: Error: Method not found: 'promiseToFuture'.
    value = await util.promiseToFuture(thenable);
                       ^^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:122:14: Error: Method not found: 'hasProperty'.
    if (util.hasProperty(e, 'code')) {
             ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:133:22: Error: Method not found: 'allowInterop'.
    PromiseJsImpl<S>(allowInterop((

                     ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:145:5: Error: Method not found: 'allowInterop'.
    allowInterop(c.completeError);

    ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:153:27: Error: Method not found: 'getProperty'.

  String get code => util.getProperty(_source, 'code');
                          ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:156:30: Error: Method not found: 'getProperty'.   String get message => util.getProperty(_source, 'message');
                             ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:159:27: Error: Method not found: 'getProperty'.   String get name => util.getProperty(_source, 'name');
                          ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:162:37: Error: Method not found: 'getProperty'.

  Object get serverResponse => util.getProperty(_source, 'serverResponse');
                                    ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:165:28: Error: Method not found: 'getProperty'.

  String get stack => util.getProperty(_source, 'stack');
                           ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:176:15: Error: Method not found: 'instanceof'.   return util.instanceof(object, type);
              ^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:180:19: Error: Undefined name 'window'.   Object? start = window;
                  ^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/utils.dart:185:18: Error: Method not found: 'getProperty'.
    start = util.getProperty(start, item);

                 ^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/auth.dart:330: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-9.0.2/lib/src/auth.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final nextWrapper = allowInterop((firebase_interop.UserJsImpl? user) {
                        ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/auth.dart:334: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-9.0.2/lib/src/auth.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final errorWrapper = allowInterop((e) => changeController.addError(e));

                         ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/auth.dart:362:9: 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-9.0.2/lib/src/auth.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
        allowInterop((firebase_interop.UserJsImpl? user) {
        ^^^^^^^^^^^^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/auth.dart:365:9: 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-9.0.2/lib/src/auth.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.

        allowInterop(idTokenChangedController.addError),
        ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/database.dart:156: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-9.0.2/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-9.0.2/lib/src/database.dart:158:28: 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-9.0.2/lib/src/database.dart').

Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final onCompleteWrap = allowInterop(
                           ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/database.dart:291:26: 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-9.0.2/lib/src/database.dart').

Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final callbackWrap = allowInterop((
                         ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/database.dart:320: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-9.0.2/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-9.0.2/lib/src/database.dart:397:24: 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-9.0.2/lib/src/database.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final actionWrap = allowInterop((d) => action(DataSnapshot.getInstance(d)));
                       ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:312:25: 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-9.0.2/lib/src/storage.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final nextWrapper = allowInterop(
                        ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:318: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-9.0.2/lib/src/storage.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    final onCompletion = allowInterop(() {
                         ^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-9.0.2/lib/src/storage.dart:329:9: 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-9.0.2/lib/src/storage.dart'). Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.

        allowInterop(_changeController.addError),
        ^^^^^^^^^^^^ Unhandled exception: FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ajs; 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:623:37)

#2      writeDepfile (package:vm/kernel_front_end.dart:763:21) <asynchronous suspension>

#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:586:9) <asynchronous suspension>
#4      starter (package:flutter_frontend_server/server.dart:85:12)

<asynchronous suspension>
#5      main (file:///C:/b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:13:24)

<asynchronous suspension>

FAILURE: Build failed with an exception.
* Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* 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 BUILD FAILED in 13s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-15 04:42:51

这可能是由于多种原因造成的。你可以试试:

  1. 删除kernel_snapshot.dkernel_snapshot.stamp文件

颤振工程\.dart_tool\flutter_build\742478cdbb2672c05d106c6da3c117ec.

您可能在我的pubspec文件中导入了纯web依赖项,或者检查您是否错误地导入了像import 'dart:html';.这样的错误文件。

flutter clean.

  1. Try flutter pub get,因为它看起来像是找不到您的包之一,如果这不起作用,那么就试一试flutter pub get

看起来你使用的是firebase: ^9.0.2,它只支持网络平台,你试图在安卓设备上构建应用程序。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71474708

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档