flutter master channel issue - android

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

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

Related

Runtime jar files should have the same version

I ran flutter build apk command, and got this error message:
-warning: runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/df/.gradle/caches/transforms-3/c4db2a2e2bfa2cf0924c25e91aac4d6a/transformed/jetified-kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
C:/Users/df/.gradle/caches/transforms-3/b0126bc96e555a2082a27f473d9f94a5/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
C:/Users/df/.gradle/caches/transforms-3/2326aa9655cc3a19a1b75942737122e7/transformed/jetified-kotlin-stdlib-1.7.10.jar (version 1.7)
C:/Users/df/.gradle/caches/transforms-3/b051c0392c8cb298c95166e24c62b4c4/transformed/jetified-kotlin-stdlib-common-1.7.10.jar (version 1.7)
warning: some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
C:\Users\df\.gradle\caches\modules-2\files-2.1\androidx.annotation\annotation\1.5.0\857678d6b4ca7b28571ef7935c668bdb57
e15027\annotation-1.5.0.jar!\META-INF\annotation.kotlin_module: error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
C:\Users\df\.gradle\caches\transforms-3\2326aa9655cc3a19a1b75942737122e7\transformed\jetified-kotlin-stdlib-1.7.10.jar
!\META-INF\kotlin-stdlib.kotlin_module: error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
C:\Users\df\.gradle\caches\transforms-3\b051c0392c8cb298c95166e24c62b4c4\transformed\jetified-kotlin-stdlib-common-1.7
.10.jar!\META-INF\kotlin-stdlib-common.kotlin_module: error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> Compilation error. See log for more details
* 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 17m 38s
Running Gradle task 'assembleRelease'... 1074.0s
┌─ 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 │
│ C:\Users\df\AndroidStudioProjects\healthypub\android\build.gradle: │
│ ext.kotlin_version = '<latest-version>'
I have already installed the latest version of Kotlin Gradle plugin which is version 1.8.0 RC2 in Android Studio. Please help me fix this issue. I want to get apk file.

My Flutter app cloned from the GitHub doesn't run and show these errors. I'm new to flutter. I changed Sdk version to 30, 31 but it didn't work

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
One or more issues found when checking AAR metadata values:
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-29).
Dependency: androidx.window:window-java:1.0.0-beta04.
AAR metadata file: C:\Users\Rasula Wathsara\.gradle\caches\transforms-3\41a83d0cf61e3d2ab42ea706b65148ab\transformed\jetified-window-java-1.0.0-beta04\META-INF\com\android\build\gradle\aar-metadata.properties.
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-29).
Dependency: androidx.window:window:1.0.0-beta04.
AAR metadata file: C:\Users\Rasula Wathsara\.gradle\caches\transforms-3\bb9a53f8c4dc071c681fa071739dc70b\transformed\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 12s
Exception: Gradle task assembleDebug failed with exit code 1
Detailed StackOverflow Answer
This usually happens when you're opening someone else's project after unzipping it and your current Android Studio Version is older to the version the project was compiled in.
The way to solve it is
Go to Help and about to see your android studio version
go to File>Project Structure> and set your Android Gradle Plugin version to your android studio version
Change the Gradle version to the one you usually use.
Build the project and it should run without any errors
app/src/build.gradle
defaultConfig {
applicationId "com.example"
minSdkVersion 19
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
android/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
}
You can try this.

Fresh Flutter App Error: app:checkDebugAarMetadata

So, I'm using the command line and VScode. I'm just trying to get Flutter to run so I can try it out again, but I keep running into this error. I used it before a few months ago and now I'm trying to start a new app. Any ideas?
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\Iverson\.gradle\caches\transforms-2\files-2.1\625039eaad011f884ddd84f857a44b7f\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\Iverson\.gradle\caches\transforms-2\files-2.1\a78fdf90e4c1f8464b19895cfb365f3f\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 4s
Running Gradle task 'assembleDebug'... 5.2s
Exception: Gradle task assembleDebug failed with exit code 1
Hmm, I just reinstalled Java and it started working. Specifically, I made sure Java 8 was working.
You should set minSdkVersion on build.grade by lower number, like this
minSdkVersion 21

Faild to run flutter app in Android Emulator with Android Studio

When I run flutter app in Android Emulator with Android Studio,it throws a error like this:
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: /Users/yh/.gradle/caches/transforms-2/files-2.1/625039eaad011f884ddd84f857a44b7f/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: /Users/yh/.gradle/caches/transforms-2/files-2.1/a78fdf90e4c1f8464b19895cfb365f3f/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 11m 11s
Exception: Gradle task assembleDebug failed with exit code 1
anyone can help me?

Warning: The plugin firebase_storage requires Android SDK version 31. One or more plugins require a higher Android SDK version

Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
Warning: The plugin cloud_firestore requires Android SDK version 31.
Warning: The plugin firebase_auth requires Android SDK version 31.
Warning: The plugin firebase_core requires Android SDK version 31.
Warning: The plugin firebase_storage requires Android SDK version 31.
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to E:\Flutter App\cash_mimo\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\Neno.gradle\caches\transforms-2\files-2.1\1f04460684db0596892f5ab231ef0c5b\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\Neno.gradle\caches\transforms-2\files-2.1\4bb066a21b46f5ea31ef8cd7876fc626\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 10s
Exception: Gradle task assembleDebug failed with exit code 1
your error log has already solution provided :
Fix this issue by adding the following to E:\Flutter App\cash_mimo\android\app\build.gradle: android { compileSdkVersion 31 ... }
The following plugins need CompileSdkVersion 31:
cloud_firestore
firebase_auth
firebase_core
firebase_storage
You have two options:
Either you change the compilesdkVersion to 31 in your build.gradle file: android/app/build.gradle
You downgrade all plugins mentioned above to a version which does not require compilesdkVersion 31
Navigate to your local.properties file and add this line flutter.compileSdkVersion=33. Now go back to build.gradle file inside the app folder and change this line compileSdkVersion flutter.compileSdkVersion to compileSdkVersion localProperties.getProperty('flutter.compileSdkVersion').toInteger()
This picture should
If you want to build your app without upgrading target SDK version for some reason, you can downgrade your android gradle version by adding below code to dependencies in: /project_root/build.gradle:
classpath 'com.android.tools.build:gradle:4.0.2'
You have to update your compile and target sdk version as 31 on app gradle

Categories

Resources