Android Studio Gradle任务的assembleDebug问题是否有解决方案

0wi1tuuw  于 2023-03-03  发布在  Android
关注(0)|答案(1)|浏览(181)

我有一个电子商务Flutter代码,并试图运行它在我的机器,但我面临着这个问题。

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\Ahmad\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\Ahmad\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 45s
Running Gradle task 'assembleDebug'...                             46.8s
Exception: Gradle task assembleDebug failed with exit code 1`

这里产生 Flutter 刮刀

Doctor summary (to see all details, run flutter doctor -v):
\[√] Flutter (Channel stable, 3.7.3, on Microsoft Windows \[Version 10.0.22000.1574\], locale en-AE)
\[√] Windows Version (Installed version of Windows is version 10 or higher)
\[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
\[√] Chrome - develop for the web
\[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2022 17.5.0)
\[√] Android Studio (version 2021.3)
\[√] Connected device (4 available)
\[√] HTTP Host Availability

• No issues found!

我已经尝试删除.gradle文件夹,仍然有同样的问题。
我将该项目移动到保存的项目仍然包含它的目录中。
现在我有了这些错误。

`../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/material_with_modal_page_route.dart:4:1: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
import '../modal_bottom_sheet.dart';
^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/firebase_core-1.24.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
    FirebaseAppPlatform.verifyExtends(_delegate);
                        ^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:28:13: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
      .push(ModalBottomSheetRoute<T>(
            ^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:50:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.  
 - 'Object' is from 'dart:core'.
 - 'Future' is from 'dart:async'.
  return result;
         ^
../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart:102:13: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
      .push(ModalBottomSheetRoute<T>(
            ^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart:125:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
 - 'Object' is from 'dart:core'.
 - 'Future' is from 'dart:async'.
  return result;
         ^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\mydesk\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1151

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\mydesk\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 45s
Running Gradle task 'assembleDebug'...                             46.8s
Exception: Gradle task assembleDebug failed with exit code 1
`

请任何人都可以帮助我在Flutter和Android Studio 新
谢谢

jecbmhm3

jecbmhm31#

你好@阿布杜勒巴塞特·阿尔赫纳维
这是以前的错误。您可以参考以下文章https://www.programmersought.com/article/68154823442/
希望这有帮助!

相关问题