0

Current JDK version 1.8 has a bug that prevents Room from being incremental this look like Current JDK version 1.8 has a bug that prevents Room from being incremental , but....

m1 device optimize using zulu jdk

/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home

m1 device is not optimize when using sdk from Android Studio

/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home

before i was use kapt 'androidx.room:room-compiler:2.3.0' where i have active to the plugin id 'kotlin-kapt'

so how i can use zulu sdk instead of android jdk without error bug that prevents Room from being incremental ? any have trick ?

my device is lagging, hot, and drained battery when use android jdk.

Current JDK version 1.8.0_292-b10 has a bug (https://bugs.openjdk.java.net/browse/JDK-8007720) that prevents Room from being incremental. Consider using JDK 11+ or the embedded JDK shipped with Android Studio 3.5+. but what i have research the jdk 11+ is not support on android studio.

edit 1 I have try with Zulu-11.jdk ./gradlew assembleDebug --stacktrace the exception is same

java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
Yogi Arif Widodo
  • 563
  • 6
  • 22

1 Answers1

0

I also faced the problem. My steps for solving was

  • Using Zulu SDK 11
  • Adding dependency kapt "org.xerial:sqlite-jdbc:3.34.0" on app gradle (If it isn't solved using zulu jdk 11)

If you are using Hilt add the following compile option for kapt at the end of app Gradle file

kapt {
    javacOptions {
        // These options are normally set automatically via the Hilt Gradle plugin, but we
        // set them manually to workaround a bug in the Kotlin 1.5.20
        option("-Adagger.fastInit=ENABLED")
        option("-Adagger.hilt.android.internal.disableAndroidSuperclassValidation=true")
    }
}
Eishon
  • 1,274
  • 1
  • 9
  • 17