Fixed
Status Update
Comments
sa...@google.com <sa...@google.com>
js...@google.com <js...@google.com>
js...@google.com <js...@google.com>
js...@google.com <js...@google.com> #2
We don't support cross-process invalidations yet.
da...@gmail.com <da...@gmail.com> #3
Comment has been deleted.
da...@gmail.com <da...@gmail.com> #4
Okey, I made it and created a method to invalidate all observables below;
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
an...@google.com <an...@google.com> #5
Cross process invalidation is now support in Room 2.1.0 with the enableMultiInstanceInvalidation() API.
an...@google.com <an...@google.com> #6
The fixes for this issue are now also available in:
- Android Studio Ladybug | 2024.2.1 Patch 1
- Android Gradle Plugin 8.7.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
js...@google.com <js...@google.com> #7
Sorry again for introducing a regression on "patch." Alas, there won't be the next patch for that patch, i.e., no AGP 8.6.2 apparently. However, as shown at
Description
The following code fails with
WrongConstant
when running./gradlew lint
under AGP 8.6.1. It passes with AGP 8.6.0.Likely regression from https://issuetracker.google.com/issues/364261817
Minimal Reproducible Example
STEPS TO REPRODUCE:
MyApplication2.zip
./gradlew lint
- failslibs.versions.toml
: change AGP to 8.6.0./gradlew lint
- passesLikely Cause