0

Here is android studio project app module script file(build.gradle.kts) segment:

android { .... compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = "11" } } dependencies { implementation(libs.androidx.recyclerview) compileOnly(files("libs/framework.jar")) } gradle.projectsEvaluated { tasks.withType<JavaCompile> { val newFiles = mutableListOf<File>().apply { add(File("libs/framework.jar")) options.bootstrapClasspath?.let { addAll(it.files) } } options.bootstrapClasspath = files(newFiles) } } 

Compiling project using this configure still cann't find hidden api in framework.jar, like TypedArray.getThemeAttributeId. Can anyone help to give an solution to fix this?

Ps: I found that jvm config as 1.8 works well, just jvm 11 as above had this issue. Also, latest kotlin plugin org.jetbrains.kotlin.android version 2.2.0 also fails while 2.0.0 works fine. Can anyone explain what cause this phenomenon, thank a lot.

1
  • 1
    Why do you add the jar file to the bootstrap path to begin with? Just use the normal way and add it the the classpath. Commented Sep 17 at 12:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.