android-maps-utils icon indicating copy to clipboard operation
android-maps-utils copied to clipboard

Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.

Open rafaelslucindo opened this issue 10 months ago • 9 comments

The error occurs when trying to compile with release 3.11.0.


Error

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDev_datamobDebugJavaWithJavac'.
> java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.

Configurações do Projeto

Gradle Plugin Version: 8.8.1 org.jetbrains.kotlin.android: 2.1.10

rafaelslucindo avatar Feb 25 '25 18:02 rafaelslucindo

Hi @rafaelslucindo,

This is being triggered by a Compose Lint checks, e.g. https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]droidx/compose/runtime/lint/ComposableFlowOperatorDetector.kt

You should get rid of this by:

  • Disabling the Lint rule
  • Add Kotlinx JVM metadata 2.1.0

kikoso avatar Feb 26 '25 07:02 kikoso

Hi @rafaelslucindo,

This is being triggered by a Compose Lint checks, e.g. https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]droidx/compose/runtime/lint/ComposableFlowOperatorDetector.kt

You should get rid of this by:

  • Disabling the Lint rule
  • Add Kotlinx JVM metadata 2.1.0

But my project do not use Compose.

rafaelslucindo avatar Feb 26 '25 11:02 rafaelslucindo

But my project do not use Compose.

Could you try adding the following line to your dependencies?

runtimeOnly("org.jetbrains.kotlin:kotlinx-metadata-jvm:0.9.0")

kikoso avatar Feb 26 '25 11:02 kikoso

runtimeOnly("org.jetbrains.kotlin:kotlinx-metadata-jvm:0.9.0")

Did not work. One observations: I do not use kotlin in my project.

FAILURE: Build completed with 8 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkQa_datamobDebugAarMetadata'.
> Could not resolve all files for configuration ':app:qa_datamobDebugRuntimeClasspath'.
   > Could not find org.jetbrains.kotlin:kotlinx-metadata-jvm:0.9.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlinx-metadata-jvm/0.9.0/kotlinx-metadata-jvm-0.9.0.pom
       - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlinx-metadata-jvm/0.9.0/kotlinx-metadata-jvm-0.9.0.pom
       - https://jitpack.io/org/jetbrains/kotlin/kotlinx-metadata-jvm/0.9.0/kotlinx-metadata-jvm-0.9.0.pom
       - s3://datamob.maven.s3-sa-east-1.amazonaws.com/org/jetbrains/kotlin/kotlinx-metadata-jvm/0.9.0/kotlinx-metadata-jvm-0.9.0.pom
     Required by:
         project :app

I have added in this way. Is that ok?

    //Location
    implementation 'com.google.android.gms:play-services-location:21.3.0'
    implementation 'com.google.android.gms:play-services-maps:19.1.0'
    implementation 'com.google.maps.android:android-maps-utils:3.11.0'
    runtimeOnly("org.jetbrains.kotlin:kotlinx-metadata-jvm:0.9.0")

rafaelslucindo avatar Feb 26 '25 12:02 rafaelslucindo

@rafaelslucindo , could you try with the following instead? Kotlin Metadata has changed its naming coordinate.

runtimeOnly("org.jetbrains.kotlin:kotlin-metadata-jvm:YOUR_KOTLIN_VERSION")

kikoso avatar Feb 27 '25 09:02 kikoso

@rafaelslucindo , could you try with the following instead? Kotlin Metadata has changed its naming coordinate.

runtimeOnly("org.jetbrains.kotlin:kotlin-metadata-jvm:YOUR_KOTLIN_VERSION")

As I said before, I don't use Kotlin in my project. I removed all references. Do I need to add it?

If I use version 3.10.0 everything works correctly.

rafaelslucindo avatar Feb 27 '25 13:02 rafaelslucindo

Hi @rafaelslucindo . Regardless of whether you are using Kotlin on your project, can you try adding this dependency? Try the version 2.1.0

This seems to be a problem with Kotlin forcing a metadata version (even if you don’t use Kotlin is being pulled in by the library).

If it doesn’t work, would it be possible to post a list of the dependencies you are using?

kikoso avatar Feb 27 '25 14:02 kikoso

Hi @rafaelslucindo . Regardless of whether you are using Kotlin on your project, can you try adding this dependency? Try the version 2.1.0

This seems to be a problem with Kotlin forcing a metadata version (even if you don’t use Kotlin is being pulled in by the library).

If it doesn’t work, would it be possible to post a list of the dependencies you are using?

It does not work.

* What went wrong:
Execution failed for task ':app:compileDev_datamobDebugJavaWithJavac'.
> java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.

Dependencies

dependencies {
    //Android
    implementation 'androidx.core:core:1.15.0'
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
    implementation 'androidx.recyclerview:recyclerview:1.4.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'

    //Datamob
    implementation 'br.com.datamob.bibliotecas.android.nativo:geral:1.0.114'

    //Room
    implementation 'androidx.room:room-runtime:2.6.1'
    annotationProcessor 'androidx.room:room-compiler:2.6.1'

    //Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.11.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.11.0'

    //Firebase
    implementation platform('com.google.firebase:firebase-bom:33.9.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-messaging'

    //AWS
    implementation 'com.amazonaws:aws-android-sdk-core:2.79.0'
    implementation 'com.amazonaws:aws-android-sdk-mobile-client:2.79.0'
    implementation 'com.amazonaws:aws-android-sdk-s3:2.79.0'
    implementation 'com.amazonaws:aws-android-sdk-rekognition:2.79.0'

    //Location
    implementation 'com.google.android.gms:play-services-location:21.3.0'
    implementation 'com.google.android.gms:play-services-maps:19.1.0'
    implementation 'com.google.maps.android:android-maps-utils:3.11.0'
    runtimeOnly 'org.jetbrains.kotlin:kotlin-metadata-jvm:2.1.0'

    //JWT
    implementation 'io.jsonwebtoken:jjwt:0.12.6'

    //Work/Job
    implementation 'androidx.work:work-runtime:2.10.0'

    //Multidex
    implementation 'androidx.multidex:multidex:2.0.1'

    //Google Play
    implementation 'com.google.android.play:app-update:2.1.0'

    //Guava
    implementation 'com.google.guava:guava:33.4.0-android'

    //Lifecycle Service
    implementation 'androidx.lifecycle:lifecycle-service:2.8.7'

    //Picasso
    implementation 'com.squareup.picasso:picasso:2.71828'

    //MPAndroidChart
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}

rafaelslucindo avatar Feb 27 '25 16:02 rafaelslucindo