在 android studio 4.1.1 中创建 android 库模块时如何设置字节码级别?

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

此图显示了当我们从模块类型列表中创建新模块时弹出的对话框。这里我选择了 Android 库。 This image shows the pop up dialog when we create a new module from the list of module types.

我认为这个设置代表了compileOptionskotlinOptions

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

例如,如果您将 ByteCode Level 设置为 6,则您创建的模块 build.gradle 中的 compileOptionskotlinOptions 将如下所示。

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

另外,如果ByteCode Level设置为8,将显示如下。

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