Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
This is a hard one. We can't easily read native crashes from that Motorola device since their system image is not public. I assume you can't reproduce this either, but if possible can you try using WorkManager 2.0.0 or 1.0.1-rc01? This would help track down the possible changes that might have introduced this issue. Thanks!
[Deleted User] <[Deleted User]> #3
We actually did reproduce it, the current store version of Pocket Casts has WorkManager 2.0.0 and this bug if you want to try and test something. I will try 1.0.1-rc01 and report back.
yb...@google.com <yb...@google.com> #4
Is there a difference between 1.0.1 and 2.0.1? We tried 2.0.1 and it was crashing, if there is a difference I can try 1.0.1 but I thought they were the same?
[Deleted User] <[Deleted User]> #5
Can you also describe how you trigger the bug and which devices manifest the problem? Is it just running the app? Is it doing something specific?
yb...@google.com <yb...@google.com> #6
We are testing on a Moto X running Android 6.0 but our play store report shows numerous motorola devices are crashing as the attached screenshots show. We just downloaded a bunch of episodes (which uses workmanager) and eventually it started crashing, it would then crash at start up every time.
ap...@google.com <ap...@google.com> #7
So to answer your earlier question, 1.0.1 should be equivalent but I think there may be some small differences in Room between 1.0 and 2.0 and since this crash seems related to Room, that's why we were asking if you could check to see if you can reproduce it on 1.x.
Regarding the initial crash, do you have any logs for that?
Regarding the initial crash, do you have any logs for that?
Description
Version used: 2.0.0
Devices/Android versions reproduced on: N/A
In current version of room if I mark method in DAO with @Transaction, and if it uses any disposable e.g. Single, the generated code will throw main thread access exception at runtime.
I would expect one of two behaviours instead:
1. It would be ideal if room could somehow defer start/end transaction to match thread that is used on Disposable, but I can imagine that this can be not possible.
2. To get compile time warning or error that this may be not the correct way of using @Transaction with mix of asynchronous code.
Example of code:
Method in abstract DAO:
@Transaction
open fun upsert(obj: T): Single<Boolean> {
return insert(obj)
.map { true }
.onErrorResumeNext {
if (it is SQLiteConstraintException)
{ update(obj)
.map { true }
} else {
Single.error(it) }
}
.subscribeOn(Schedulers.io()) }
Generated method:
@Override
public Single<Boolean> upsert(Supplier obj) {
__db.beginTransaction();
try {
Single<Boolean> _result = super.upsert(obj);
__db.setTransactionSuccessful();
return _result;
} finally {
__db.endTransaction();
}
}