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:
- [Solved] SQLite Error: SQLite error near “@table“: syntax error
- React-native Error: Make sure you have the Android development environment set up [Solved]
- [Solved] Xcode13.1 Upgrade Error: CocoaPods installed but not working Failed to build gem native extension
- Solve the problem that the native machine cannot use ant script checkout project
- [Solved] React Native Red screen Error: Unable to load script from assets
- [Solved] Android Studio Error: ERROR: Cause: executing external native build for cmake
- [Solved] Azkaban Error: Missing required property ‘azkaban.native.lib’
- [Solved] Tensorflow Error: Failed to load the native TensorFlow runtime.
- Room DB Error: AppDatabase_Impl does not exist [How to Solve]
- Cocoapods Install ERROR: Error installing cocoapods: ERROR: Failed to build gem native extension.
- Unable to find bundled Java version =>Mac Flutter [Android Studio Arctic Fox 2020.3.1]
- [Solved] Mac Notebook M1 Chip Install Hashlips library npm error
- package golang.org/x/net/XXX: unrecognized import path “golang.org/x/net/xxx“…
- MAC: Brew upgrade Error [How to Fix]
- How to Solve Mac installation luajit error
- Mac office Run-time error ‘53 [How to Solve]
- [Solved] Curl: (22) the requested URL returned error: 404 when installing XXX on MAC brew
- Mac Vscode C++ Customize Header File Error: linker command failed
- Go build package error: TARGET_OS_MAC & IOMasterPort
- [Solved] Mac M1 Brew install Error: Command failed with exit 128:git