```>> ./gradlew cleanBuildCache Starting a G...
# community-support
l
Copy code
>> ./gradlew cleanBuildCache
Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Laiba\HealthMate\frontend\android\build.gradle.kts' line: 1

* What went wrong:
Error resolving plugin [id: 'org.jetbrains.kotlin.android', version: '2.1.20', apply: false]
> The request for this plugin could not be satisfied because the plugin is already on the classpath with a different version (1.9.22).

* 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 6m 19s
6 actionable tasks: 1 executed, 5 up-to-date------------------------------------------how to resolve this plugin version conflict
v
Well, as the error states, you added the plugin in version 1.9.22 to the classpath for example by having it in parent project buildscript classpath or the settings script classpath and now try in
frontend/android/build.gradle.kts
to add it in veresion 2.1.20 to the classpath again and that does not work.
More cannot really be deducted from the snippet you shared.
l
Copy code
@Vampire ok by running the project it shows this  how can I get further detail is there any way to update in class path to latest version:                      Launching lib\main.dart on SM A325F in debug mode...

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\Laiba\HealthMate\frontend\android\build.gradle.kts' line: 1

* What went wrong:
Error resolving plugin [id: 'org.jetbrains.kotlin.android', version: '2.1.20', apply: false]
> The request for this plugin could not be satisfied because the plugin is already on the classpath with a different version (1.9.22).

* 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
Running Gradle task 'assembleDebug'...                             22.4s
Error: Gradle task assembleDebug failed with exit code 1
v
As I said, you try to use the same plugin in two different version in the same hierarchy of projects. That snippet is not showing anything else than the previous. Check where you use those two versions of the plugin and harmonize the versions.
l
Copy code
@Vampire does this msg helpful to resolve error:------------------------------------------------------ e: file:///C:/Users/laiba/.gradle/caches/8.10.2/transforms/05af6d6971691015b7b6a0e5a8137584/transformed/jetified-play-services-measurement-impl-22.4.0-api.jar!/META-INF/java.com.google.android.gms.libs.filecompliance.proto_file_access_api_type_kt_proto_lite.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///C:/Users/laiba/.gradle/caches/8.10.2/transforms/05af6d6971691015b7b6a0e5a8137584/transformed/jetified-play-services-measurement-impl-22.4.0-api.jar!/META-INF/third_party.kotlin.protobuf.src.commonMain.kotlin.com.google.protobuf.kotlin_only_for_use_in_proto_generated_code_its_generator_and_tests.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///C:/Users/laiba/.gradle/caches/8.10.2/transforms/05af6d6971691015b7b6a0e5a8137584/transformed/jetified-play-services-measurement-impl-22.4.0-api.jar!/META-INF/third_party.kotlin.protobuf.src.commonMain.kotlin.com.google.protobuf.kotlin_shared_runtime.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///C:/Users/laiba/.gradle/caches/8.10.2/transforms/1a4891c0ca4f5b27faa659f388e18611/transformed/jetified-firebase-auth-23.2.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.firebase-auth-api_firebase-auth-api.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.
e: file:///C:/Users/laiba/.gradle/caches/8.10.2/transforms/22f903db8df1c63e5bd7dfac24394239/transformed/jetified-play-services-measurement-api-22.4.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_moduleModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.9.0.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > 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 1m 52s
Running Gradle task 'assembleRelease'...                          112.8s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.                                 │
│ Find the latest version on <https://kotlinlang.org/docs/releases.html#release-details>, then update the  │
│ version number of the plugin with id "org.jetbrains.kotlin.android" in the plugins block of            │
│ C:\HealthMate\frontend\android\settings.gradle.                                                        │
│                                                                                                        │
│ Alternatively (if your project was created before Flutter 3.19), update                                │
│ C:\HealthMate\frontend\android\build.gradle                                                            │
│ ext.kotlin_version = '<latest-version>'                                                                │
└────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1
v
This message now means you fixed the problem of different version for one plugin. What it is telling you now is, that you use dependencies that were compiled using Kotlin 2.1 with a Kotlin 1.9 compiler and that does not work. Because the Kotlin 1.9 compiler only understands classes produced by up to Kotlin 2.0, always one version ahead.
l
now how to resolve this now? @Vampire
v
Either use a newer Kotlin version, or use older versions of those libraries
l
Copy code
@Vampire I am using version 2.1.0 but  it shows this: FAILURE: Build failed with an exception.

* Where:
Build file 'C:\HealthMate\frontend\android\app\build.gradle.kts' line: 1

* What went wrong:
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.android', version: '2.1.0']
> Failed to apply plugin 'org.jetbrains.kotlin.android'.
   > Could not create an instance of type org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget.
      > Could not generate a decorated class for type KotlinAndroidTarget.
         > com/android/build/gradle/api/BaseVariant

* 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 3s
Running Gradle task 'assembleRelease'...                            3.8s
Gradle task assembleRelease failed with exit code 1
I am stuck here for almost 4 hours. @Vampire
v
Most probably the AGP version you are using is not compatible with the KGP version you are using now. But I'm not into Android development and Android is always special. 🤷‍♂️