Status Update
Comments
da...@google.com <da...@google.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
ch...@googlemail.com <ch...@googlemail.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
ap...@google.com <ap...@google.com> #4
-
Second crash in the description is from a real device. Experienced it myself on two different Xiaomi phones, plus lots of crashes from users in the Google Play console.
-
Dynamic features are not used in the application.
As a wild guess, I have downgraded build tools from 31.0.0 to 30.0.3, compileSdk from 31 to 30, and moved all work with Language ID to the service in a separate process (just to be sure that crash can kill secondary process instead of main). This combination is in beta for 2 days by now and I don't see any SIGSEGV crashes.
da...@google.com <da...@google.com> #5
Hmm, I feel the crash might be something related to separate/secondary process.
I also changed compileSdk and targetSDK to 31 but still cannot repro this issue.
Description
Version used: 1.2.0
When I define an entity with a protected field that only has a getter, room tries to use the getter name to assing a value to the field.
Example:
@androidx.room.Entity
public class Entity {
@PrimaryKey
protected int id;
/**
* This getter is the problem - if I @Ignore it, everything works
*/
public int getId() {
return id;
}
}
This generates the following code in the DAO:
final Entity _item;
_item = new Entity();
_item.getId = _cursor.getInt(_cursorIndexOfId);
_result.add(_item);
This of course fails to compile ("Cannot find symbol variable getId").
I have attached a project that reproduces the problem.