Fixed
Status Update
Comments
wo...@gmail.com <wo...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
[Deleted User] <[Deleted User]> #3
jf...@gmail.com <jf...@gmail.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
yb...@google.com <yb...@google.com> #5
ugh ok, we've made this change to work around an sqlite bug where it was seeing an old version of the database.
clearly not well tested sorry, we'll quickly work on this post IO.
you can stay in beta3 which is not much different than rc1 until we ship 1.1.1
clearly not well tested sorry, we'll quickly work on this post IO.
you can stay in beta3 which is not much different than rc1 until we ship 1.1.1
ah...@gmail.com <ah...@gmail.com> #6
Just wasted a couple of hours and wrote the same issue, but discarded it after seeing this one. Rolling back to 1.1.0-beta2
yb...@google.com <yb...@google.com> #7
#4 it is just a log not a problem, you can safely ignore that one.
jf...@gmail.com <jf...@gmail.com> #8
#7 Are you referring to "E/ROOM: Invalidation tracker is initialized twice :/." Log? I suppose you can ignore that, but in the case of a migration on 1.1.0 it shows that the `room_table_modification_log` was not created after the database was closed and reopened.
yb...@google.com <yb...@google.com> #9
yep, the modification log thing is an error we'll fix. the invalidation tracker thing is just a log that you can ignore in this case.
yb...@google.com <yb...@google.com> #10
I'm working on the fix, meanwhile please do not use 1.1 as it will break invalidation tracking post migration even if it does not crash.
wo...@gmail.com <wo...@gmail.com> #11
Thanks for keeping us updated. Maybe you can wait a little longer in the future between RC and release?
yb...@google.com <yb...@google.com> #12
we normally do (bake RCs 2 weeks). this was the push to ship things at IO :/ (conference deadlines).
and this bug was in beta but unfortunately didn't get caught until now :/
sorry about the issue, we'll ship a 1.1.1 RC soon.
and this bug was in beta but unfortunately didn't get caught until now :/
sorry about the issue, we'll ship a 1.1.1 RC soon.
aa...@gmail.com <aa...@gmail.com> #13
No it's not just a log problem. I added the migration of adding new column of string, in the first launch the first insert fails. So the data is lost.
aa...@gmail.com <aa...@gmail.com> #14
In my case, the error looks like:
Cannot run invalidation tracker. Is the db closed?
java.lang.IllegalStateException: The database '/data/data/com.pushcoin.app.reggie.debug/databases/reggie_transaction.db' is not open.
Cannot run invalidation tracker. Is the db closed?
java.lang.IllegalStateException: The database '/data/data/com.pushcoin.app.reggie.debug/databases/reggie_transaction.db' is not open.
yb...@google.com <yb...@google.com> #15
shipped in 1.1.1-rc1.
that CL only includes this fix so hopefully safe to migrate to .
that CL only includes this fix so hopefully safe to migrate to .
km...@gmail.com <km...@gmail.com> #16
I had same issue like Cannot run invalidation tracker. Is the db closed? on room version 1.0.0, but just log issue. (it didn't occur crash)
And I checked it was fixed on room version 1.1.1-rc1. I wonder when the official 1.1.1 version will be released?
And I checked it was fixed on room version 1.1.1-rc1. I wonder when the official 1.1.1 version will be released?
yb...@google.com <yb...@google.com> #17
we are just letting rc-1 bake to see if any error shows up. going clean so far so might release it in a week or two.
feel free to use it, it does not have any additional features etc.
feel free to use it, it does not have any additional features etc.
wo...@gmail.com <wo...@gmail.com> #18
I see this bug as really critical and would like to see a warning right here:
https://developer.android.com/topic/libraries/architecture/adding-components#room
That it crashes on migrations and strongly recommend users to use a previous version or the RC.
That it crashes on migrations and strongly recommend users to use a previous version or the RC.
tr...@gmail.com <tr...@gmail.com> #19
I'm getting this as well (when inserting a row after migrations), but I'm using the new Jetpack dependencies (androidx.room:room-runtime:2.0.0-alpha1). It sure seems as if the fix isn't included in that, but I wanted to double check in case the issue just hadn't been truly resolved yet.
b9...@gmail.com <b9...@gmail.com> #20
Yup how about androidx 2.0.0-alpha1?
yb...@google.com <yb...@google.com> #21
we'll ship a new version of androidX room to fix that. and hoping to ship 1.1.1 this week, we've not received any bugs and we see many people using it so should be fine by now.
jf...@gmail.com <jf...@gmail.com> #22
Is this fix now ? I'm having this issue!
b9...@gmail.com <b9...@gmail.com> #23
I could see 1.1.1 is shipped at 6/19 but androidX room hasn't released yet. :(
sw...@gmail.com <sw...@gmail.com> #24
I am also facing the same issue
yb...@google.com <yb...@google.com> #25
it is already shipped so please try with the latest version
de...@gmail.com <de...@gmail.com> #26
it is still happened with version 2.2.0-rc01
yb...@google.com <yb...@google.com>
al...@gmail.com <al...@gmail.com> #27
Hitting the same issue in Room 2.2.3. Looks like it was fixed in 1.1.1-rc1 according to some old comments, but it's broken again in Room 2.X.X.
yb...@google.com <yb...@google.com> #28
is it the same table modification log error? Can you share some data, which devices are you seeing it or are you able to reproduce?
vi...@gmail.com <vi...@gmail.com> #29
Crashing on Oneplus 6t Android 10. We're closing the database in onDestroy and seems like the only solution is to not close the database?
Room version 2.2.5
Room version 2.2.5
ch...@gmail.com <ch...@gmail.com> #30
Crashing on Room 2.2.0:
Device:
Pixel XL
Android 10
Security patch: October 6, 2019
Kernel: 3.18.137-g72a7a64494e
1 Fri Sep 27 18:40:34 UTC 2019
Build number: QP1A.191005.007.A3
Device:
Pixel XL
Android 10
Security patch: October 6, 2019
Kernel: 3.18.137-g72a7a64494e
1 Fri Sep 27 18:40:34 UTC 2019
Build number: QP1A.191005.007.A3
ho...@gmail.com <ho...@gmail.com> #31
After few days i found solution!
I got same issue like #4. And it comes on some devices like OnePlus 6t because application relaunch MainActivity at start, so when we call database.close() in activity OnDestroy() we also need set 'null' to database instance (if you use singleton class for working with your database). So i created my own function on my singleton database class and call it on in activity OnDestroy() function. Hope its helpful!
My database class:
abstract class AppDatabase: RoomDatabase() {
abstract fun TestDao(): TestDao
companion object {
@Volatile
private var INSTANCE: AppDatabase? = null
fun getDatabase(context: Context): AppDatabase{
val tempInstance = INSTANCE
if(tempInstance != null){
return tempInstance
}
synchronized(this){
val instance = Room.databaseBuilder(
context.applicationContext,
AppDatabase::class.java,
"database_name"
)
.build()
INSTANCE = instance
return instance
}
}
fun closeConnection() {
if(INSTANCE != null){
Log.i("room", "reset instance")
INSTANCE!!.close()
INSTANCE = null
}
}
}
}
I got same issue like #4. And it comes on some devices like OnePlus 6t because application relaunch MainActivity at start, so when we call database.close() in activity OnDestroy() we also need set 'null' to database instance (if you use singleton class for working with your database). So i created my own function on my singleton database class and call it on in activity OnDestroy() function. Hope its helpful!
My database class:
abstract class AppDatabase: RoomDatabase() {
abstract fun TestDao(): TestDao
companion object {
@Volatile
private var INSTANCE: AppDatabase? = null
fun getDatabase(context: Context): AppDatabase{
val tempInstance = INSTANCE
if(tempInstance != null){
return tempInstance
}
synchronized(this){
val instance = Room.databaseBuilder(
context.applicationContext,
AppDatabase::class.java,
"database_name"
)
.build()
INSTANCE = instance
return instance
}
}
fun closeConnection() {
if(INSTANCE != null){
Log.i("room", "reset instance")
INSTANCE!!.close()
INSTANCE = null
}
}
}
}
Description
Version used: 1.1.0-rc1
Devices/Android versions reproduced on: all
Seeing many crashes when users update to our latest build using Room 1.1.0-rc1. I've included a stack-trace here.
It seems to be crashing once when the user upgrades to this build, then not on future launches of that same build. Maybe Room isn't creating this table in time?