Status Update
Comments
ja...@gmail.com <ja...@gmail.com> #2
de...@gmail.com <de...@gmail.com> #3
Logs after follow mentioned steps in
===============================================
V/TAG: ViewModelFirst Created
2) Can you please provide the below requested information to better understand the issue:
Android build
Which Android build are you using? (e.g. KVT49L)
Device used
Which device did you use to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
de...@gmail.com <de...@gmail.com> #4
ho...@gmail.com <ho...@gmail.com> #5
I have this problem on all my devices. Here are some of them:
1. Samsung Galaxy S9 (SM-G960F)
Android: 8.0.0 build: R16NW.G960FXXU1BRE5
2. Pixel2
Android: 9 build: PPP3.180510.008
3. Galaxy A3 (SM-A320FL)
Android: 7.0 build: NRD90M.A320FLXXS2BRAA
The three attachments included are: The built apk, the source code and a video displaying the issue.
The video showcases the app running on Galaxy S9 (Phone 1) with the following order:
1. Set "Don't keep activities" to enabled.
2. Happy case when everything is correct and onCleared() is called.
3. Fault case when the home button is pushed and onCleared() __is not called__.
da...@google.com <da...@google.com> #6
Fragments currently use the fact that the system called onSaveInstanceState() as a marker on whether the Activity could be recreated. "Don't keep activities" specifically breaks that assumption by saving the instance state, then immediately throwing it away.
In a typical system, the only time that saved instance state would be thrown away would be if your process is being destroyed, of which there is no callback (either to your app or to ViewModels). Therefore this bug is limited to only devices using "Don't keep activities".
Saved state is an imperfect signal here, so we'll switch to the correct signal - Activity.isChangingConfigurations().
da...@google.com <da...@google.com> #7
yy...@gmail.com <yy...@gmail.com> #8
ma...@gmail.com <ma...@gmail.com> #9
za...@gotocme.com <za...@gotocme.com> #10
da...@google.com <da...@google.com> #11
?
Can you reproduce it there? If you can, it shouldn't be closed. If you can't maybe it should be closed too.
si...@gmail.com <si...@gmail.com> #12
zs...@gmail.com <zs...@gmail.com> #13
Thanks! Do you think 2.4.3
is something that will be released in the next couple weeks? Trying to decide if I want to use the workaround or just wait until it is released.
da...@google.com <da...@google.com> #14
ge...@gmail.com <ge...@gmail.com> #15
da...@google.com <da...@google.com>
19...@gmail.com <19...@gmail.com> #16
pi...@gmail.com <pi...@gmail.com> #17
Maybe reopen this.
@Query("SELECT * FROM ${SetupData.TABLE_NAME}")
suspend fun selectAll(): Cursor
[ksp] SetupDataDao.kt:24: Not sure how to convert a Cursor to this method's return type (android.database.Cursor).
Duh!
- Room 2.5.2
- Kotlin 1.9
- KSP 1.9.0-1.0.11
te...@gmail.com <te...@gmail.com> #18
da...@google.com <da...@google.com> #19
The diagnosis is the same, Room needs to update its kotlinx-metadata-jvm dependency to be able to read Kotlin 1.9+ metadata. An upcoming patch release (Room 2.5.3) will have the dep updated.
da...@google.com <da...@google.com> #20
Alternative if you use the KSP version of Room, this shouldn't be an issue.
io...@gmail.com <io...@gmail.com> #21
ri...@gmail.com <ri...@gmail.com> #22
bl...@gmail.com <bl...@gmail.com> #23
da...@davwheat.dev <da...@davwheat.dev> #24
ra...@gmail.com <ra...@gmail.com> #25
ma...@gmail.com <ma...@gmail.com> #26
sh...@navi.com <sh...@navi.com> #27
rc has been out since 20th sept
mr...@gmail.com <mr...@gmail.com> #28
pa...@gmail.com <pa...@gmail.com> #29
ah...@gmail.com <ah...@gmail.com> #30
Upgraded room to version to 2.6.1 and the issue is resolved!
ni...@gmail.com <ni...@gmail.com> #31
Issue is still present if you want to return Cursor
Room 2.7.0-alpha12 kotlinVersion = "2.1.0" kspVersion = "2.1.0-1.0.29"
Sample: @Query("SELECT * FROM ${SetupData.TABLE_NAME}") suspend fun selectAll(): Cursor [ksp] Not sure how to convert a Cursor to this method's return type (android.database.Cursor).
Description
Component used: Room with suspend functions i.e. coroutines
error:
/Users/jayshah/AndroidStudioProjects/SampleMemoryNotes/app/build/tmp/kapt3/stubs/debug/com/example/samplememorynotes/framework/db/NoteDao.java:17: error: Not sure how to convert a Cursor to this method's return type (java.lang.Object). public abstract java.lang.Object getNoteEntity(long id, @org.jetbrains.annotations.NotNull()
Usage:
Version used:
Devices/Android versions reproduced on: Android emulator
If this is a bug in the library, we would appreciate if you could attach: