How to set byteCode level when creating a android library module in android studio 4.1.1?

Viewed 2620
1 Answers

I think that this setting represents the compileOptions and kotlinOptions.

https://developer.android.com/studio/write/java8-support

For example, if you set ByteCode Level to 6, the compileOptions and kotlinOptions in the build.gradle of the module you created will look like this.

android {
    .
    .
    .
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }
    kotlinOptions {
        jvmTarget = '1.6'
    }
}

Also, if ByteCode Level is set to 8, the following will be shown.

android {
    .
    .
    .
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}
Related