Fixed
Status Update
Comments
js...@google.com <js...@google.com>
je...@google.com <je...@google.com>
bi...@google.com <bi...@google.com> #2
We don't support cross-process invalidations yet.
jf...@block.xyz <jf...@block.xyz> #3
At least , add a "refresh all observables" function to alpha4 ? i am trying to implement it by myself with your InvalidationTracker class
bi...@google.com <bi...@google.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.
dg...@oreillyauto.com <dg...@oreillyauto.com> #6
This appears to be causing a problem when using older versions of gradle (5.6.4 specifically).
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/y0/nrtsz1g53qq5c37yzk6s7cv80000gn/T/ijresolvers1.gradle' line: 162
* What went wrong:
No signature of method: org.gradle.api.internal.provider.DefaultProviderFactory.gradleProperty() is applicable for argument types: (String) values: [com.android.tools.utp.GradleAndroidProjectResolverExtension.enable]
Possible solutions: hasProperty(java.lang.String)
FAILURE: Build failed with an exception.
* Where:
Initialization script '/private/var/folders/y0/nrtsz1g53qq5c37yzk6s7cv80000gn/T/ijresolvers1.gradle' line: 162
* What went wrong:
No signature of method: org.gradle.api.internal.provider.DefaultProviderFactory.gradleProperty() is applicable for argument types: (String) values: [com.android.tools.utp.GradleAndroidProjectResolverExtension.enable]
Possible solutions: hasProperty(java.lang.String)
Description
In Android Studio Ladybug Canary 09, when tests are run from the IDE, the injected
ijresolvers2.gradle
init script contains multiple instances ofProject.hasProperty
added byaddGradleAndroidTestListener.gradle
fromGradleAndroidProjectResolverExtension
.Project.hasProperty
is an isolated projects violation in most cases because if the project doesn't have the requested property, Gradle searches upward through parent projects to the root.