Room database is not working in mac book pro m1
i have already added id ‘kotlin-kapt’
screen shoot of android studio console log
- What went wrong: Execution failed for task ‘:app:kaptDebugKotlin’.
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
java.lang.reflect.InvocationTargetException (no error message)Caused by: java.lang.reflect.InvocationTargetException at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at
org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:90)
at
org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:31)
at org.jetbrains.kotlin.kapt3.base.Kapt.kapt(Kapt.kt:45) … 31 moreCaused by: java.lang.Exception: No native library is found for
os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
at
org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:333)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64)
at
androidx.room.verifier.DatabaseVerifier.(DatabaseVerifier.kt:71)
… 50 more
2
Answers
Simply use Room 2.4.0-alpha03
Edit : The answer consisted of two solutions to solve the issue , since the above written solution was successful for many ,the other solution is removed .
add dependency:
kapt "org.xerial:sqlite-jdbc:3.34.0"