retrofit - The binary version of its metadata is 1.9.0, expected version is 1.5.1

40 Views Asked by At

I am getting all of sudden an error as below.

/Users/developer/.gradle/caches/transforms-3/b85d3ca1d1a3ee19e6a335126cc9759f/transformed/jetified-retrofit-2.10.0.jar!/META-INF/retrofit.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.5.1.

Project gradle file is as below.

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url = "https://jitpack.io"}
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.0"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
        classpath 'com.google.gms:google-services:4.3.10'
        classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        google()
        jcenter() // Warning: this repository is going to shut down soon
        maven { url = 'https://jitpack.io' }
        maven { url "https://artifact.bytedance.com/repository/AwemeOpenSDK" }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app gradle file is as below.

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
    id 'com.google.gms.google-services'
}

android {
    compileSdk 31

    defaultConfig {
        applicationId "com.app"
        minSdk 24
        targetSdk 31
        versionCode 5
        versionName "1.4"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            crunchPngs false  // Paste this line
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    viewBinding {
        enabled = true
               }

}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation files('libs/UnifiedAPI-1.0.jar')
    implementation files('libs/NeptuneLiteApi_V3.25.00_20210706.jar')
    implementation 'com.google.firebase:firebase-messaging-ktx:23.0.3'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'



    implementation 'com.squareup.okhttp:okhttp:2.7.5'
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2+'
    implementation "com.squareup.retrofit2:retrofit:2.4.0"
    implementation "com.squareup.retrofit2:converter-gson:2.4.0"
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'

}

The code was working fine in morning but now in afternoon it's not working.

Any idea what is going wrong?

This is weird behavior. Even retrofit 2.10.0 is not downloaded...

0

There are 0 best solutions below