0

My project base is developed on Flutter 1.0. when upgrade to 2.0 and update code, plugin and everthing it can run OK, but now that I upgraded from Flutter 2.0 to 2.5 it gets an error. I can't solve my project error. Then tried to solve it with this post but it didn't work.

Console error:

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:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed /home/jui/.gradle/caches/transforms-2/files-2.1/ab231ee2f2fa8dc93f62d941a01ead4b/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

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


I updated android/app/build.gradle compileSdkVersion 31, targetSdkVersion 31 and updated android/build.gradle

configurations.all {
        resolutionStrategy {
            force 'androidx.core:core-ktx:1.6.0'
        }
    }

by add end of line, but I got a new error:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /home/jui/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.31/43331609c7de811fed085e0dfd150874b157c32/kotlin-stdlib-common-1.5.31.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
.
.
.
.
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':audioplayers:compileDebugKotlin'.
> 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 9s
Exception: Gradle task assembleDebug failed with exit code 1
karel
  • 5,489
  • 46
  • 45
  • 50
  • for the second issue, you probably have to run `gradlew clean` to remove inconsistencies... – Jiří Aug 09 '22 at 21:12
  • for people trying to solve a similar issue while all solutions do not work, check this out: https://stackoverflow.com/a/73298232/6877668 – Jiří Aug 09 '22 at 21:26

2 Answers2

1

Using the answer from here Update compileSdkVersion and targetSdkVersion to 31

And add this code snippet in your android/build.gradle file at the very end.

configurations.all {
  resolutionStrategy {
    force 'androidx.core:core-ktx:1.6.0'
}}

Just recently the original author of audioplayers package fixed this issue in his recent PR. It has been fixed in audioplayers version 0.20.1, so if your issue is related to audioplayers, do upgrade. from here

HeIsDying
  • 335
  • 5
  • 16
0

You got the following error message in your question:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':audioplayers:compileDebugKotlin'.

Remove the audioplayers: ^0.18.2 plugin. Upgrading the plugin can't help this problem.

karel
  • 5,489
  • 46
  • 45
  • 50