Just leave my answer in case this helps someone. I ran into the same problem, none of the answers above worked. The only thing that worked was the transition from data class to class . I invite anyone to try the same code and explain why it succeeded:
Before
@Entity data class ImgurGalleryPost ( @NotNull @PrimaryKey var id: String, var title: String?, var description: String?, var datetime: Int?, var cover: String?, var coverWidth: Int?, var coverHeight: Int?, var accountUrl: String?, var accountId: Int?, var privacy: String?, var layout: String?, var views: Int?, var link: String?, var ups: Int?, var downs: Int?, var points: Int?, var score: Int?, var isAlbum: Boolean?, var vote: Boolean?, var favorite: Boolean?, var nsfw: Boolean?, var section: String?, var commentCount: Int?, var favoriteCount: Int?, var topic: String?, var topicId: Int?, var imagesCount: Int?, var inGallery: Boolean?, var isAd: Boolean?, @NotNull @Ignore var tags: List<ImgurGalleryTag>, var inMostViral: Boolean?, @NotNull @Ignore var images: List<ImgurGalleryImage> )
After
@Entity class ImgurGalleryPost ( @NotNull @PrimaryKey var id: String, var title: String?, var description: String?, var datetime: Int?, var cover: String?, var coverWidth: Int?, var coverHeight: Int?, var accountUrl: String?, var accountId: Int?, var privacy: String?, var layout: String?, var views: Int?, var link: String?, var ups: Int?, var downs: Int?, var points: Int?, var score: Int?, var isAlbum: Boolean?, var vote: Boolean?, var favorite: Boolean?, var nsfw: Boolean?, var section: String?, var commentCount: Int?, var favoriteCount: Int?, var topic: String?, var topicId: Int?, var imagesCount: Int?, var inGallery: Boolean?, var isAd: Boolean?, @NotNull @Ignore var tags: List<ImgurGalleryTag>, var inMostViral: Boolean?, @NotNull @Ignore var images: List<ImgurGalleryImage> )
This is really strange, but I doubt this is a problem with the Android Studio cache, because when I return to the data class error reappears. This seems to be some kind of issue with collection fields. I checked the constructor in the generated class and it looked fine, I donβt know why the assembly failed even when the constructor was generated correctly:
public ImgurGalleryPost(@org.jetbrains.annotations.NotNull() java.lang.String id, @org.jetbrains.annotations.Nullable() java.lang.String title, @org.jetbrains.annotations.Nullable() java.lang.String description, @org.jetbrains.annotations.Nullable() java.lang.Integer datetime, @org.jetbrains.annotations.Nullable() java.lang.String cover, @org.jetbrains.annotations.Nullable() java.lang.Integer coverWidth, @org.jetbrains.annotations.Nullable() java.lang.Integer coverHeight, @org.jetbrains.annotations.Nullable() java.lang.String accountUrl, @org.jetbrains.annotations.Nullable() java.lang.Integer accountId, @org.jetbrains.annotations.Nullable() java.lang.String privacy, @org.jetbrains.annotations.Nullable() java.lang.String layout, @org.jetbrains.annotations.Nullable() java.lang.Integer views, @org.jetbrains.annotations.Nullable() java.lang.String link, @org.jetbrains.annotations.Nullable() java.lang.Integer ups, @org.jetbrains.annotations.Nullable() java.lang.Integer downs, @org.jetbrains.annotations.Nullable() java.lang.Integer points, @org.jetbrains.annotations.Nullable() java.lang.Integer score, @org.jetbrains.annotations.Nullable() java.lang.Boolean isAlbum, @org.jetbrains.annotations.Nullable() java.lang.Boolean vote, @org.jetbrains.annotations.Nullable() java.lang.Boolean favorite, @org.jetbrains.annotations.Nullable() java.lang.Boolean nsfw, @org.jetbrains.annotations.Nullable() java.lang.String section, @org.jetbrains.annotations.Nullable() java.lang.Integer commentCount, @org.jetbrains.annotations.Nullable() java.lang.Integer favoriteCount, @org.jetbrains.annotations.Nullable() java.lang.String topic, @org.jetbrains.annotations.Nullable() java.lang.Integer topicId, @org.jetbrains.annotations.Nullable() java.lang.Integer imagesCount, @org.jetbrains.annotations.Nullable() java.lang.Boolean inGallery, @org.jetbrains.annotations.Nullable() java.lang.Boolean isAd, @org.jetbrains.annotations.NotNull() java.util.List<com.kimboo.core.model.ImgurGalleryTag> tags, @org.jetbrains.annotations.Nullable() java.lang.Boolean inMostViral, @org.jetbrains.annotations.NotNull() java.util.List<com.kimboo.core.model.ImgurGalleryImage> images) { super(); }
If someone can find a way to fix this without switching from a data class to a class please feel free to comment below.