Reputation: 11
I've got a project that works perfectly with Android Studio Electric Eel. I can build it on my Windows 11 computer without any problem. I've tried to build it with Android Studio Flamingo without modifying anything in project, and I've got that error on compiling:
java.io.FileNotFoundException: C:\WINDOWS\sqlite-3.36.0-dd461b91-611f-4288-a925-24c8c6a154e1-sqlitejdbc.dll.lck (Acc�s refus�)
and the final causse is
Caused by: java.lang.Exception: No native library found for os.name=Windows, os.arch=x86_64, paths=[/org/sqlite/native/Windows/x86_64;C:\Users\guill\.gradle\jdks\adoptium-11-x64-hotspot-windows\jdk-11.0.19+7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;.] at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:389) at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68) at androidx.room.verifier.DatabaseVerifier.<clinit>(DatabaseVerifier.kt:70) ... 55 more
Id behind sqlite-3.36.0- changes at every build. I've got 3 sqlite-3.36.0 dlls in my Windows directory, with 3 different ids, but never the one asked for building. I can't find any help on Google. I've got the same issue with Android Studio Giraffe.
I've tried lookin for similaries issues on Google, but didn't find anything
If I run Android Studio as administrator, files in windows directory exist and can be accessed, but I've got errors in all built DAO files such as:
error: Not sure how to handle query method's return type (java.lang.Object). DELETE query methods must either return void or int (the number of deleted rows).
error: Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
Code works perfectly with Android Studio Electric Eel without being administrator.
Does anyone knows how to fix it ? Thanks
Upvotes: 1
Views: 534
Reputation: 664
Use ksp instead of kapt for room since 2.5.0
plugins {
id "com.google.devtools.ksp" version "1.8.21-1.0.11"
}
...
dependencies {
ksp "androidx.room:room-compiler:$room_version"
}
Linked google issues:
Upvotes: 0