android 如何在Mac M1上解决此问题导致:java.lang.Exception:找不到www.example.com = Mac和os的本机库,arch = aarch64os.name=Mac and os.arch=aarch64

jk9hmnmh  于 2023-01-24  发布在  Android
关注(0)|答案(4)|浏览(174)

我在我的build.gradle中使用下面的代码解决了这个问题

allprojects {
configurations.all {
    resolutionStrategy {
        force 'org.xerial:sqlite-jdbc:3.34.0'
      }
   }
 }

但它对我正在进行的项目有影响,由于某种原因,它不能与项目上实现的room sql一起工作。
我得到这个错误时,我删除了上面的代码.
有没有更好的办法解决这个问题。

Caused by: java.lang.ExceptionInInitializerError
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:82)
at androidx.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:57)
at androidx.room.RoomProcessor$DatabaseProcessingStep.process(RoomProcessor.kt:134)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:161)
at

jdk.编译器/com.sun.tools.javac.处理. java处理环境.调用处理器(java处理环境. java:980).

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.<clinit>(DatabaseVerifier.kt:68)
... 47 more
t8e9dugd

t8e9dugd1#

更新您的聊天室库

implementation "androidx.room:room-runtime:2.4.2"
   implementation "androidx.room:room-ktx:2.4.2"
   kapt "androidx.room:room-compiler:2.4.2"

这里是参考

p4tfgftt

p4tfgftt2#

在我的情况下,更新到2.4.2只要求我更新SDK版本到31,出现了更多问题。
Android Studio > Preferences > Build, Execution, Deployment > Build Tools > Gradle
导航到Gradle Project部分并单击Gradle JDK下拉选项字段

选择Liberica-1.8(如果下拉字段中没有,您可以在此处下载并安装https://bell-sw.com/pages/downloads/)。
再次运行该项目,瞧!!

yduiuuwa

yduiuuwa3#

yeb运行工作在我的情况下(我的mac迷你m1)=〉〉〉implementation "androidx.room:room-runtime:2.4.2" implementation "androidx.room:room-ktx:2.4.2"

bt1cpqcv

bt1cpqcv4#

更新你的roomdb依赖

def room_version = "2.4.2"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"

相关问题