Android Pie上的房间

时间:2018-10-31 12:10:56

标签: android sqlite android-sqlite android-room

Room在android api 28上不起作用。 我收到此错误:no such table: user (code 1 SQLITE_ERROR):, while compiling: select * from user

在其他版本上,数据库工作正常。可能是什么问题?

def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
annotationProcessor "android.arch.persistence.room:compiler:$room_version"
implementation "android.arch.persistence.room:rxjava2:$room_version"

用户实体:

@Entity(tableName = "user")
public class User {
@SerializedName("user_id")
@PrimaryKey
private long userId;
@SerializedName("created_at")
private String createdAt;
@Expose
private String lastLogin;
@SerializedName("login_count")
private Integer loginCount;
@Expose
@Embedded
private UserProperties properties;
@IgnoreJson
private long localUpdatedAt;
@SerializedName("updated_at")
private String updatedAt; 

0 个答案:

没有答案