'flutter master channel issue

Launching lib\main.dart on AOSP on IA Emulator in debug mode... Running Gradle task 'assembleDebug'... Warning: The plugin path_provider_android requires Android SDK version 31. Warning: The plugin shared_preferences_android requires Android SDK version 31. One or more plugins require a higher Android SDK version. Fix this issue by adding the following to D:\App Dev Projects\marvelyprojects\android\app\build.gradle: android { compileSdkVersion 31 ... }

Parameter format not correct -

FAILURE: Build failed with an exception.

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

Multiple task action failures occurred: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.window:window-java:1.0.0-beta04. AAR metadata file: C:\Users\ashra.gradle\caches\transforms-2\files-2.1\8f42c4deb4a5577a51d166e18b5fb030\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties. A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction > The minCompileSdk (31) specified in a dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties) is greater than this module's compileSdkVersion (android-30). Dependency: androidx.window:window:1.0.0-beta04. AAR metadata file: C:\Users\ashra.gradle\caches\transforms-2\files-2.1\3f788c64cd9fb84deaf5d81b1bbcf4d4\jetified-window-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.

  • 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 11s Exception: Gradle task assembleDebug failed with exit code 1



Solution 1:[1]

Following steps fixed the same issue which I was facing on flutter/vscode.

1/..android\app\build.gradle: change 'compileSdkVersion' and 'targetSdkVersion' to 31 (from 30)

2/ above change gave new error ==> ....

build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:2: AAPT: error: attribute 'package' in tag is not a valid Android package name: 'com.ulusoyapps.sharewhatyouknow.002-navigator2'.

3/ as per https://developer.android.com/guide/topics/manifest/manifest-element.html#package, packagge name was incorrect. I changed it to 'com.ulusoyapps.sharewhatyouknow.a002_navigator2' , "package" ==> build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml "applicationId" ==> android\app\build.gradle

4/ above change gave following error... BUILD FAILED in 11s ?? Flutter Fix ????????????????????????????????????????????????????????????????????????????????????? ? [!] Your project requires a newer version of the Kotlin Gradle plugin. ? ? Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then ? ? update D:\adnan\flutter\ex\Flutter-ShareWhatYouKnow-develop\002-navigator2\android\build.gradle: ? ? ext.kotlin_version = '' ? ????????????????????????????????????????????????????????????????????????????????????????????????????

5/ changed ext.kotlin_version = '1.3.50' in ... android\build.gradle to 1.6.10

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 adnan ul haque