heec.choi
01/03/2024, 10:04 AMSummers Pittman
01/03/2024, 3:10 PMSummers Pittman
01/03/2024, 3:16 PMSummers Pittman
01/03/2024, 7:53 PM<service
android:name="androidx.work.impl.background.systemjob.SystemJobService"
android:process=":remote"
tools:node="merge" />
All widget receivers need to use the same process, but this should unblock you. LMK if that doesn't work (works on my machine)heec.choi
01/04/2024, 4:29 AMheec.choi
01/04/2024, 4:30 AM<receiver
android:name=".widget.CustomAppWidgetReceiver"
android:enabled="true"
android:exported="false"
android:process=":remote">
....
</receiver>
2) Issues and resolve
2-1) Error occurs (java.lang.IllegalStateException: WorkManager is not initialized properly.)
→ Remove default workmanager initializer at AndroidManifest.xml and declare custom workmanager's configuration
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />
</provider>
class GlanceApp : Application(), Configuration.Provider {
override val workManagerConfiguration: Configuration
get() = Configuration.Builder().setDefaultProcessName(packageName).build()
}
2-2) Can't get Session object for key. It appears to be because the process in which the worker runs is not declared as :remote
→ It was resolved by setting :remote using the method mentioned above.
3) Question
<service
android:name="androidx.work.impl.background.systemjob.SystemJobService"
android:process=":remote"
tools:node="merge" />
→ It appears to be code that sets the process in which WorkManager operates to :remote
Wouldn't this affect the operation of WorkManager, which is already being used in the default process?Summers Pittman
01/04/2024, 3:22 PMheec.choi
01/05/2024, 1:15 AMimplementation("androidx.glance:glance-appwidget:1.0.0")
implementation("androidx.glance:glance:1.0.0")