簡體   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