繁体   English   中英

任务 ':app:compileFlutterBuildRelease' 执行失败。 在 Flutter 创建 APK

[英]Execution failed for task ':app:compileFlutterBuildRelease'. on Flutter creating APK

我正在使用最新的 Android Studio。 它有编译错误不知道我如何得到它?

D:\path\of\project>flutter build apk

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Running Gradle task 'assembleRelease'...
lib/ui/screens/splash_screen.dart:52:20: Error: The getter 'updateAvailable' isn't defined for the class 'AppUpdateInfo'.

 - 'AppUpdateInfo' is from 'package:in_app_update/in_app_update.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/in_app_update-2.0.0/lib/in_app_update.da
rt').

Try correcting the name to the name of an existing getter, or defining a getter or field named 'updateAvailable'.

    if(_updateInfo.updateAvailable){

                   ^^^^^^^^^^^^^^^

lib/ui/screens/intro_screen.dart:208:7: Error: No named parameter with the name 'shouldHideStatusBar'.

      shouldHideStatusBar: false,

      ^^^^^^^^^^^^^^^^^^^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/intro_slider-2.4.3/lib/intro_slider.dart:149:3: Context: Found this candidate, but the arguments don't match.

  IntroSlider({

  ^^^^^^^^^^^

lib/ui/screens/home_screen.dart:55:24: Error: The method 'configure' isn't defined for the class 'FirebaseMessaging'.

 - 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-d
ev.15/lib/firebase_messaging.dart').

Try correcting the name to the name of an existing method, or defining a method named 'configure'.

    _firebaseMessaging.configure(

                       ^^^^^^^^^

lib/services/download/download_episode_page.dart:839:29: Error: The method 'split' isn't defined for the class 'Object'.

 - 'Object' is from 'dart:core'.

Try correcting the name to the name of an existing method, or defining a method named 'split'.

    var newFile = cFileName.split('/').last;

                            ^^^^^

lib/services/download/download_page.dart:921:33: Error: The method 'split' isn't defined for the class 'Object'.

 - 'Object' is from 'dart:core'.

Try correcting the name to the name of an existing method, or defining a method named 'split'.

    var fileNamenew = cFileName.split('/').last;

                                ^^^^^

lib/custom_player/src/chewie_player.dart:86:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.

      resizeToAvoidBottomPadding: false,

      ^^^^^^^^^^^^^^^^^^^^^^^^^^

/C:/src/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match.

  const Scaffold({

        ^^^^^^^^

lib/custom_player/src/chewie_player.dart:279:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/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(_ChewieControllerProvider)

                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^





FAILURE: Build failed with an exception.



* Where:

Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991



* What went wrong:

Execution failed for task ':app:compileFlutterBuildRelease'.

> 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 4m 0s
Running Gradle task 'assembleRelease'...                          241.8s
Gradle task assembleRelease failed with exit code 1

如果我看一下 flutter 医生 -v 它显示

D:\path\of\project>flutter doctor -v
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 6.1.7601], locale en-US)
    • Flutter version 2.0.6 at C:\src\flutter
    • Framework revision 1d9032c7e1 (13 days ago), 2021-04-29 17:37:58 -0700
    • Engine revision 05e680e202
    • Dart version 2.12.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\Home\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Java\jdk1.8.0_131\bin\java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212


请告诉我该如何解决?

我在 flutter 上使用“稳定”连接。 我确实升级了 flutter 和污垢。 所有的插件都安装了,但它不工作..而且也变得像

“错误:没有为 class 'AppUpdateInfo' 定义 getter 'updateAvailable'。” “错误:没有名为‘shouldHideStatusBar’的命名参数。” “错误:没有为 class 'FirebaseMessaging' 定义方法 'configure'。” “错误:没有为 class '对象'定义方法 'split'。” “错误:没有名为‘resizeToAvoidBottomPadding’的命名参数。” “错误:没有为 class 'BuildContext' 定义方法 'inheritFromWidgetOfExactType'。” 一切尽在一处。

我什么都试过了。。还是有问题。

谢谢

这是由于您使用的是 Flutter 版本。 尝试将您的 Flutter 版本更改为 1.2 可能会有所帮助。 如我所见,IntroSlider ChewPlayer 中存在错误。 尝试更新此插件并检查它的属性,例如 shouldHideStatusBar 现在是 hidestatusbar。 您必须手动查找所有更改。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM