Bug P3
Status Update
Comments
el...@google.com <el...@google.com> #2
Forgot to note the environment.
This crash occurs on only API 21.
This crash occurs on only API 21.
al...@gmail.com <al...@gmail.com> #3
This crash occurs on API 22 and 23 when the user doesn't have Google Play installed. Related discussions: https://stackoverflow.com/q/41025200/842697
[Deleted User] <[Deleted User]> #5
For me this still persisted in 1.1.0-rc01 as well as 1.1.0-alpha01.
Only downgrading all my androidx version to the previously working state helped.
From:
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.core:core:1.2.0-alpha04'
back to:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta03'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'androidx.core:core:1.2.0-alpha03'
Only downgrading all my androidx version to the previously working state helped.
From:
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.core:core:1.2.0-alpha04'
back to:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta03'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'androidx.core:core:1.2.0-alpha03'
Description
Version used: 2.5.0 alpha2 and 2.5.0 alpha3
Devices/Android versions reproduced on: Android Studio 2021.2.1 Patch 2
I create a new entity for the database and it throws me this error while migrating:
Caused by: java.lang.IllegalStateException: Migration didn't properly handle: emergency(hero.db.model.Emergency).
Expected:
TableInfo{name='emergency', columns={emergency_record_id=Column{name='emergency_record_id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, vehicle_plate=Column{name='vehicle_plate', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, device_id=Column{name='device_id', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, user_id=Column{name='user_id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, sent_to_cloud=Column{name='sent_to_cloud', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, location=Column{name='location', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, id=Column{name='id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=1, defaultValue='null'}, emergency_description=Column{name='emergency_description', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, timestamp=Column{name='timestamp', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}}, foreignKeys=[], indices=[]}
Found:
TableInfo{name='emergency', columns={emergency_record_id=Column{name='emergency_record_id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, vehicle_plate=Column{name='vehicle_plate', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, device_id=Column{name='device_id', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, user_id=Column{name='user_id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, sent_to_cloud=Column{name='sent_to_cloud', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, location=Column{name='location', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, id=Column{name='id', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=1, defaultValue='null'}, emergency_description=Column{name='emergency_description', type='TEXT', affinity='2', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}, timestamp=Column{name='timestamp', type='INTEGER', affinity='3', notNull=notNull, primaryKeyPosition=0, defaultValue='null'}}, foreignKeys=[], indices=[]}
the entity model is:
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(tableName = AppDatabase.TABLE_EMERGENCY)
public class Emergency {
@ColumnInfo(name = "emergency_record_id")
private Integer emergencyRecordId;
@ColumnInfo(name = "vehicle_plate")
private String vehiclePlate;
@ColumnInfo(name = "device_id")
private String deviceId;
@ColumnInfo(name = "user_id")
private Long userId;
@ColumnInfo(name = "sent_to_cloud")
@JsonIgnore
private Boolean sentToCloud = false;
@ColumnInfo(name = "location")
private LocationRoute location;
@PrimaryKey
@ColumnInfo(name = "id")
private Long id;
@ColumnInfo(name = "emergency_description")
private String emergencyDescription;
@ColumnInfo(name = "timestamp")
private Date timeStamp;
}
the query use is:
"CREATE TABLE IF NOT EXISTS " + TABLE_TRIP + " (\n " +
"id INTEGER PRIMARY KEY NOT NULL,\n " +
"plate TEXT ,\n " +
"device_id INTEGER ,\n " +
"user_id INTEGER ,\n " +
"timestamp DATETIME ,\n " +
"sent_to_cloud BOOLEAN ,\n " +
" );",