Home > Blockchain >  How to solve Execution failed for task ‘:app:compileFlutterBuildDebug’ in Flutter
How to solve Execution failed for task ‘:app:compileFlutterBuildDebug’ in Flutter

Time:08-05

One or more plugins require a higher Android SDK version. Fix this issue by adding the following to F:\app\cirilla\android\app\build.gradle: android { compileSdkVersion 33 ... }

Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level> lib/service/messaging.dart:21:70: Error: Too many positional arguments: 2 allowed, but 3 found. Try removing the extra positional arguments. const AndroidNotificationChannel channel = AndroidNotificationChannel( ^ /C:/src/flutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-9.7.0/lib/src/platform_specifics/android/notification_channel.dart:10:9: Context: Found this candidate, but the arguments don't match. const AndroidNotificationChannel( ^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/service/messaging.dart:139:50: Error: Too many positional arguments: 2 allowed, but 3 found. Try removing the extra positional arguments. android: AndroidNotificationDetails( ^ /C:/src/flutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-9.7.0/lib/src/platform_specifics/android/notification_details.dart:12:9: Context: Found this candidate, but the arguments don't match. const AndroidNotificationDetails( ^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/widgets/cirilla_phone_input/cirilla_phone_input.dart:102:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.addPostFrameCallback(_getSizes); ^ lib/themes/default/chat/chat_messages.dart:70:54: Error: No named parameter with the name 'previewData'. final updatedMessage = _messages[index].copyWith(previewData: previewData); ^^^^^^^^^^^ lib/themes/default/chat/chat_messages.dart:72:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance?.addPostFrameCallback((_) { ^ /C:/src/flutterSDK/flutter/.pub-cache/git/flutter_swiper-d82a8baefaf10749228e42e6806ce4ffa83d7e0c/lib/src/custom_layout.dart:33:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.addPostFrameCallback(_getSize); ^ /C:/src/flutterSDK/flutter/.pub-cache/git/flutter_swiper-d82a8baefaf10749228e42e6806ce4ffa83d7e0c/lib/src/transformer_page_view/transformer_page_view.dart:524:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.addPostFrameCallback(_onGetSize); ^ /C:/src/flutterSDK/flutter/.pub-cache/git/flutter_swiper-d82a8baefaf10749228e42e6806ce4ffa83d7e0c/lib/src/transformer_page_view/transformer_page_view.dart:542:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/widgets/binding.dart'). WidgetsBinding.instance!.addPostFrameCallback(_onGetSize); ^

FAILURE: Build failed with an exception.

  • Where: Script 'C:\src\flutterSDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutterSDK\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 58s Exception: Gradle task assembleDebug failed with exit code 1

CodePudding user response:

Try in lib/widgets/cirilla_phone_input/cirilla_phone_input.dart:102:20 to remove '!' operator

CodePudding user response:

first change compileSdkVersion to 33 in app build.gradle compileSdkVersion 33

in last 'WidgetsBinding'

void addPostFrameCallback(
    FrameCallback callback
    )
  • Related