我试图迁移到objectbox iv构建一个例子 iv配置所有需要的gradle project gradle:
buildscript {
ext.object_box_version = '1.0.1'
repositories {
maven { url "http://objectbox.net/beta-repo/" }
}
dependencies {
classpath "io.objectbox:objectbox-gradle-plugin:$object_box_version"
}
allprojects {
repositories {
maven { url "http://objectbox.net/beta-repo/" }
}
}
}
app gradle:
apply plugin: 'io.objectbox'
dependencies {
implementation "io.objectbox:objectbox-android:$object_box_version"
implementation "io.objectbox:objectbox-kotlin:$object_box_version"
kapt "io.objectbox:objectbox-processor:$object_box_version"
}
用户类:
@Entity
class User(
@Id
var id: Long = 0,
var name: String = ""
)
当我创建我的App类来构建BoxStore时,我发现MyObjectBox但是在我的代码中引用了它并且我点击了重建后我得到错误找不到MyObjectBox(或任何其他ObjectBox生成的类,如Entity_ ..)
答案 0 :(得分:1)
我失踪的是
apply plugin: 'kotlin-kapt'