79388480

Date: 2025-01-26 12:05:22
Score: 1.5
Natty:
Report link

to complement the answer https://stackoverflow.com/a/79301018/17570148:

If you only change the values ​​of the id "com.android.application" version "8.1.0" apply false, and update grladle to 8.3, you may have some problem related to incompatibility between the target JVM versions configured for the Java compiler (in my case; 1.8) and the Kotlin compiler (in my case; 17).

enter image description here enter image description here

To solve this inconsistency, it is necessary to align the target JVM versions for both compilers. In the android/app/build.gradle file:

android { 
    ... 
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17 // change the version here (VERSION_17 is my case)
        targetCompatibility JavaVersion.VERSION_17 // change the version here (VERSION_17 is my case)
    }

    // if your file doesn't have this line, you need to add it to ensure that the Kotlin compiler uses the same JVM version as the Java compiler:
    kotlinOptions {
        jvmTarget = "17" // 17 in my case
    }
}
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Aurelio Fernam