Mac M1 Android Kotlin Mac and os.arch=aarch64错误

 换了m1跑旧kotlin项目编译报错

Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
   > java.lang.reflect.InvocationTargetException (no error message)

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

一定要点 Run with --info 看报错信息,错误信息如下:

Caused 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:68)
    ... 49 more

解决方案

//引入这个包
kapt "org.xerial:sqlite-jdbc:3.34.0"

 

你可能感兴趣的:(android开发,android,studio)