Check out example codes for "Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option". It will help you in understanding the concepts better.

Code Example 1

android {
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }
}

Code Example 2

compileKotlin {
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }
}

Code Example 3

In build.gradle app file

android{
.....

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }
    
    }

Learn ReactJs, React Native from akashmittal.com