Problem Description:
When building a project with m1 chip, if you use room, you will get the following error because the sqlite jar package is not compatible with arm.
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)
... 50 more
Solution:
To update the room version, you don’t need to add org.xerial:sqlite-jdbc:3.34.0 as the web says, just update the room directly as shown below.
def room_version = "2.4.0-beta01"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava2:$room_version"
Read More:
- How to Solve Android jetpack Room Schema export Error
- [Solved] Android Room: Database Common Error ‘missing database’
- How to Solve svn error: WC DB
- How to Solve Jetpack room use error
- Apple M1: How to Solve Spark runs Error
- SVN ERROR (E200033): database is locked [How to Solve]
- How to Solve AD20 Channel-Offset Error
- error: resource android:attr/lStar not found [How to Solve]
- error: resource android:attr/lStar not found? [How to Solve]
- DevC++ Error: [Error] Id returned 1 exit status [How to Solve]
- [Solved] ELK Log System Error: “statusCode“:429,“error“:“Too Many Requests“,“message“ Data too large
- [Solved] Flink jdbc Error: Access Denied for user ‘root‘@‘10.0.0.x‘ (using password: YES)
- [Easy Solution] flutter Run Error: library “libflutter.so“ not found
- [Solved] AAPT: error: resource android:attr/lStar not found
- [Solved] Hive 2.3.9 Error: Error: Unrecognized column type: UNIONTYPE (state=,code=0)
- Duplicate entry ‘1’ for key’PRIMARY’ (How to Solve)
- [Solved] Flink Hadoop is not in the classpath/dependencies
- DB2 detects a syntax error in the DRDA data stream: 0x3 ERRORCODE= -4499, SQLSTATE=58009
- Error: a JNI error has occurred, please check your installation and try again
- [Solved] removeerror: ‘requests’ is a dependency of CONDA and cannot be removed from