gpt4 book ai didi

android - 构建房间期间发生 StackOverflowError

转载 作者:搜寻专家 更新时间:2023-10-30 22:26:43 28 4
gpt4 key购买 nike

我正在尝试使用空间并写下:

@Entity(foreignKeys = arrayOf(ForeignKey(entity = Category::class, 
parentColumns = arrayOf("id"), childColumns = arrayOf("parentId"))))
data class Category (
val type: Byte,

val name: String,

val description: String,

var parentId: Long? = null,

var remoteId: Long? = null,

@PrimaryKey(autoGenerate = true)
val id: Long = 0L,

@Relation(parentColumn = "id", entityColumn = "parentId")
var subcategories: List<Category>? = null
)

但是我明白了:

Error:Execution failed for task ':app:kaptDebugKotlin'.
> Internal compiler error. See log for more details

和更多细节:

 java.lang.IllegalStateException: failed to analyze: 
java.lang.StackOverflowError
at org.jetbrains.kotlin.analyzer.AnalysisResult.throwIfError(AnalysisResult.kt:57)

也许有人会遇到这个问题(因为没有子类别字段一切正常)。

谢谢!

最佳答案

引用 the documentation for @Relation :

Note that @Relation annotation can be used only in Pojo classes, an Entity class cannot have relations.

理想情况下,您会得到比 StackOverflowError 更好的构建错误,但您应该会得到某种形式的构建错误。

关于android - 构建房间期间发生 StackOverflowError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50317853/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com