Closed 243573077 closed 1 month ago
You should use ksp and try to solve the compile issue.
If the problem still exists, you can give a demo project to me to reproduce it.
Thank you. I had resolved it. My resolution is like that :
create a new empty projection by ksp and language needed to choose kotlin. configure your ksp env ok.
Remove all compose depends in build.gradle.kts (in app module).
And then add dependes in your build.gradle.kts (in app module).
implementation 'com.tencent.wcdb:main:2.1.4' implementation 'com.tencent.wcdb:annotation:2.1.4' annotationProcessor 'com.tencent.wcdb:compiler:2.1.4' ksp 'com.tencent.wcdb:compiler:2.1.4'
问题描述: AS 使用的是 Android Studio Jellyfish | 2023.3.1 RC 2 WCDB 使用 java or kotlin 库, 接入版本 2.1.4 ,创建实体bean 类Bill,按官方文档接入编译后 ,通过annotationProcessor("com.tencent.wcdb:compiler:2.1.4")的方式引用wcdb的注解处理器,AS能正常编译和生成apk 但在 “db.createTable(tableName,DBBill)”中 无法引用到对应的 DBBill生成类。 官方Widi 中接入指导比较简洁,没有2.X版本对应的 Demo示例。 另外自己也尝试过 使用ksp的方式,但AS 会报编译失败。
求助: 恳请官方小伙伴,帮忙确认下是否wcdb哪里配置有问题,或者 官方是否考虑出一个 KSP 版本的Demo?thanks
具体配置和使用 如下: 项目根目录build.gradle.kts 配置内容 `
`
app 目录 build.gradle.kts配置 内容 `
} `
实体Bill类定义 `
在数据库创建表时,**出现无法 引用到 DBBill的情况**
`
将annotationProcessor 方式换为 KSP 方式,会AS 编译不过,注释掉kapt相关内容,根目录gadle.kts文件修改为 `
`
app 内gradle.kts更改为: `
AS 提示 ![图片](https://github.com/Tencent/wcdb/assets/4500285/8f82b0c2-9147-4e93-a34d-baada29e3215) 对应打印信息:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.