I have a react native 0.73.2 and working on MoEngage integration. The React Native version of MoEngage installed is 8.6.0 while the android sdk version is com.moengage:moe-android-sdk:12.10.02.
My React Native project is using Java 17 and there's an error while compiling the app:
> 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version. Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain * Try:
So, I update my (app) build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
The problem persist, I still can't compile the app.
I had the same problem, this worked for me:
build.gradle
References: