C:/Users/Admin/.gradle/caches/8.5/generated-gradle-jars/gradle-api-8.5.jar!/META-INF/configuration-cache.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0

I got above error when i update sdk from 33 to 34 and chnages the gradle version

import org.apache.tools.ant.taskdefs.condition.Os

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 21
        compileSdkVersion = 35
        targetSdkVersion = 35
     //  kotlin_version = '1.8'

        if (System.properties['os.arch'] == "aarch64") {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = "24.0.8215888"
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = "21.4.7075529"
        }
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:8.1.1')
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:4.1.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle filesb

        //  classpath 'com.android.tools.build:gradle:7.3.1' // downloads 1.7.1 Metadata
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20" // <= 1.5.20 used here
}
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
       
        maven { url 'https://www.jitpack.io' }
    }
}

subprojects { subproject ->
        if(project['name'] == 'c72-rfid-scanner'){    
            project.configurations { compile { } }
        }else{
            configurations.all {
            exclude group: "com.google.errorprone", module: "error_prone_annotations"
             }
        }
    }
#Mon Apr 14 15:06:45 IST 2025

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

You only share a very small part of the actual error.
But that line means, that you try to compile something with Kotlin 1.6 while having a dependency that was compiled with Kotlin 1.8 in the classpath, which cannot work, as the Kotlin compiler can only handle one minor version to the future.

Please share the full error, optimally using a build --scan URL if possible.

> Task :react-native-gradle-plugin:compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-gradle-plugin:compileKotlin'.
> 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.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 25s
1 actionable task: 1 executed

Build Scan® | Develocity this is the build scan url

{
  "name": "projectname",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "xcode": "xed ios",
    "freshIosSim": "npm i && npm run easebuzz-sim && cd ios && pod install && npm run xcode",
    "freshIosDev": "npm i && npm run easebuzz-dev && cd ios && pod install && npm run xcode",
    "freshAnd": "npm i && npm run easebuzz-dev && npm run android",
    "android": "react-native run-android",
    "ios": "npx react-native run-ios --device=\"Its iPhone\"",
    "start": "npx react-native start --max-workers 4 --reset-cache --port 8081",
    "adbrev": "adb reverse tcp:8081 tcp:8081",
    "easebuzz-sim": "npm install $(npm pack /Volumes/ssd/pressbuddy/etable/Other-supporting-data/easebuzz-kit-may-24/paywitheasebuzz-react-native-lib/react-native-easebuzz-kit-emulator | tail -1)",
    "easebuzz-dev": "npm install $(npm pack /Volumes/ssd/pressbuddy/etable/Other-supporting-data/easebuzz-kit-may-24/paywitheasebuzz-react-native-lib/react-native-easebuzz-kit-device | tail -1)",
    "test": "jest",
    "lint": "eslint .",
    "codepush": "appcenter codepush release-react -a nileshnmahajan/whatAinfo -d Release",
    "adbrev2": "adb reverse tcp:8088 tcp:8088",
    "start2": "react-native start --reset-cache --port 8088",
    "adbRevE": "adb -s emulator-5554 reverse tcp:8081 tcp:8081",
    "adbRevD": "adb -s adb-AMQC9TGYI7GAEUFM-7AcH6p._adb-tls-connect._tcp  reverse tcp:8081 tcp:8081",
    "metro": "react-native start",
    "connect": "npm run adbrev && npm run start",
    "bundle": "react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle",
    "instD": "cd android/app/build/outputs/apk/debug && adb install app-arm64-v8a-debug.apk",
    "instR": "cd android/app/release && adb install app-universal-release.apk",
    "linktest": "npx uri-scheme open  https://etable.co.in/hotel/7440ab02-0dc0-447b-b36d-d78b96f7825e --android",
    "branchLinkTest1": "npx uri-scheme open  https://etable.co.in/hotel/7440ab02-0dc0-447b-b36d-d78b96f7825e --android",
    "linktest2": "npx uri-scheme open  https://etable.co.in/hotel/f0b7e6e9-7e3c-480e-8180-699f4ee8269b --android",
    "PaymentSuccess": "npx uri-scheme open etable://open/profile/checkout/974 --android",
    "buildAndroidDebug": "cd android && ./gradlew assembleDebug",
    "buildAndroidRelease": "cd android && ./gradlew assembleRelease",
    "buildAndroidAAB": "cd android && ./gradlew :base:bundleDebug",
    "releaseAndroid": "cd android && ./gradlew bundleRelease"
  },
  "dependencies": {
    "@invertase/react-native-apple-authentication": "^2.4.0",
    "@pusher/pusher-websocket-react-native": "^1.3.1",
    "@react-native-async-storage/async-storage": "^2.1.2",
    "@react-native-community/cli-platform-android": "^18.0.0",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^11.4.1",
    "@react-native-google-signin/google-signin": "^13.2.0",
    "@react-native-masked-view/masked-view": "^0.3.2",
    "@react-navigation/bottom-tabs": "7.3.10",
    "@react-navigation/native": "^7.1.6",
    "@react-navigation/stack": "^7.2.10",
    "@shopify/flash-list": "^1.8.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "axios": "^1.8.4",
    "geolib": "^3.3.3",
    "jsqr": "^1.4.0",
    "moment": "^2.30.1",
    "patch-package": "^8.0.0",
    "react": "18.2.0",
    "react-localization": "^1.0.19",
    "react-native": "^0.76.9",
    "react-native-android-location-enabler": "^2.0.1",
    "react-native-branch": "^6.6.0",
    "react-native-calendar-picker": "^8.0.5",
    "react-native-camera": "^4.2.1",
    "react-native-cashfree-pg-sdk": "^2.2.0",
    "react-native-deep-linking": "^2.2.0",
    "react-native-device-info": "^14.0.4",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-exception-handler": "^2.10.10",
    "react-native-fast-image": "^8.6.3",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.25.0",
    "react-native-get-location": "^5.0.0",
    "react-native-gradle-plugin": "^0.71.19",
    "react-native-image-picker": "^8.2.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-onesignal": "^5.2.9",
    "react-native-paper": "^5.13.1",
    "react-native-qr-decode-image-camera": "^1.1.3",
    "react-native-qrcode-svg": "^6.3.15",
    "react-native-reanimated": "^3.17.3",
    "react-native-safe-area-context": "^5.3.0",
    "react-native-screens": "^4.10.0",
    "react-native-shadow-2": "^7.1.1",
    "react-native-share": "^12.0.9",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^15.11.2",
    "react-native-toast-message": "^2.2.1",
    "react-native-view-shot": "^4.0.3",
    "react-native-webview": "^13.13.5",
    "react-redux": "^9.2.0",
    "redux": "^5.0.1",
    "redux-persist": "^6.0.0",
    "sp-react-native-in-app-updates": "^1.4.1",
    "text-encoding-polyfill": "^0.6.7",
    "yup": "^1.6.1"
  },
  "devDependencies": {
    "@babel/core": "^7.26.10",
    "@babel/runtime": "^7.27.0",
    "@react-native-community/cli": "latest",
    "@react-native-community/eslint-config": "^3.2.0",
    "babel-jest": "^29.7.0",
    "babel-plugin-module-resolver": "^5.0.2",
    "eslint": "^9.24.0",
    "glob": "^10.4.5",
    "jest": "^29.7.0",
    "metro-react-native-babel-preset": "^0.77.0",
    "react-test-renderer": "18.2.0",
    "rimraf": "^5.0.10"
  },
  "jest": {
    "preset": "react-native"
  }
}

this is packge.json file

I’d say react-native-gradle-plugin 0.71.19 is simply not compatible with the Gradle version you try to upgrade to.
You probably also have to upgrade R/N.
But that is better to be asked in some R/N community I guess, or checked in the R/N documentation.
That R/N version is 2 years old.

Can you please suggest any r/n community

No, I neither do R/N nor Android