首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何解决“任务执行失败”:app:compileFlutterBuildDebug‘。

如何解决“任务执行失败”:app:compileFlutterBuildDebug‘。
EN

Stack Overflow用户
提问于 2021-01-30 12:16:20
回答 9查看 9.6K关注 0票数 12

当我试图在android上运行终端中的“颤振运行”应用程序时,我会得到以下错误.

代码语言:javascript
运行
复制
/C:/Users/Acer/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method named 'inheritFromElement'.
    return super.inheritFromElement(ancestor, aspect: aspect);
                 ^^^^^^^^^^^^^^^^^^
/C:/Users/Acer/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/Flutter/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        ? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Acer/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/Flutter/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
        : context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Users/Acer/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with 
the name 'nullOk'.
        context != null ? Localizations.localeOf(context, nullOk: true) : null,
                                                          ^^^^^^
/D:/Flutter/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
  static Locale localeOf(BuildContext context) {
                ^^^^^^^^
                                                                        

FAILURE: Build failed with an exception.

* Where:
Script 'D:\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\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 1m 50s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       121.0s
Exception: Gradle task assembleDebug failed with exit code 1

问题是,昨天它正常工作,但今天它显示了这个错误信息。请帮我解决这个问题。

EN

回答 9

Stack Overflow用户

回答已采纳

发布于 2021-02-03 08:20:18

你可能升级了颤振在一个渠道,而不是‘稳定’。在这种情况下,最简单的解决方案是打开一个终端并运行(类型) flutter downgrade

票数 0
EN

Stack Overflow用户

发布于 2021-02-11 07:03:51

更新提供程序版本4.3.3它将解决问题

票数 11
EN

Stack Overflow用户

发布于 2021-02-04 16:53:57

编辑-随着颤振2的推出,它将无法工作。答案现在已经过时了,

当我转到主播频道时遇到了这个问题。不得不降级

代码语言:javascript
运行
复制
flutter channel stable && flutter upgrade

修正了这个问题

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

https://stackoverflow.com/questions/65967833

复制
相关文章

相似问题

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