KSP房间处理器在CI机器上失败
我已经迁移了kapt的房间到KSP。 在本地计算机(MAC)上一切正常,但是在我们的Linux CI机器上,我会遇到错误,并且该应用程序不会编译。有什么想法,为什么会发生以及如何解决?
StackTrace:
Task :app:kspCustomQaKotlin
e: java.lang.ExceptionInInitializerError
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:82)
...
Caused by: java.lang.Exception: No native library found for os.name=Linux, os.arch=x86_64, paths=[/org/sqlite/native/Linux/x86_64:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
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)
I've migrated Room kapt to ksp.
Everything works fine on the local machine (Mac), but on our Linux CI machine I'm getting an error, and the app does not compile. Any ideas, why it might happen and how to fix it?
Stacktrace:
Task :app:kspCustomQaKotlin
e: java.lang.ExceptionInInitializerError
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:82)
...
Caused by: java.lang.Exception: No native library found for os.name=Linux, os.arch=x86_64, paths=[/org/sqlite/native/Linux/x86_64:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DatabaseVerifier
是房间编译器的一部分,它使用本地SQLITE实例来验证SQLite查询的正确性。它通过在计算机上的SQLite内存实例中执行查询来进行验证。这与KSP本身无关。错误的原因
表明,它无法在您的机器上找到SQLite二进制。您是否尝试过手动安装它?您还可以编写小的Gradle任务,该任务在CI上运行时检查SQLite二进制。
DatabaseVerifier
is part of the room compiler and it uses local SQLite instance to verify the correctness of the SQLite queries. It does the verification by executing the queries on a in memory instance of SQLite on the machine. This is not related to the KSP itself.Cause of the error
says that it is unable to find sqlite binary on your machine. Have you tried installing it manually? You can also write small gradle task that checks for sqlite binary when running on your CI.