I am calling several CoroutineWorker
classes in my Android application. In the past, I could easily watch details for each worker execution in the "Background Task Inspector" of Android Studio. According to the documentation, the only requirement is version 2.5.0
or above.
Coming back to the project after a while, the app inspection pane has changed and grouping has been introduced:
This is not a problem. The problem is, that all of my "CoroutineWorker"s are showing up as Jobs and all are called "SystemJobService" all of a sudden:
Instead of "SystemJobService", I expect the name of the CoroutineWorker class to be displayed. Including additional information and features like Graph View. The options are still there, but my workers are not interpreted as such, hence, I can't make use of any of the features.
All the information displayed for my workers, which are showing up as jobs:
I have tested this with Android SDK 32
, AGP 7.4.2
, am using Android Studio Flamingo 2022.2.1 Patch 2
, and (among others) have installed the following libraries:
implementation "androidx.work:work-runtime:2.7.1"
implementation "androidx.work:work-runtime-ktx:2.7.1"
implementation "androidx.work:work-multiprocess:2.7.1"
After patching the IDE, I have run the project as usual and with the new pane, my workers were interpreted as jobs, including their anonymous class names.
2.8.1
8.0.2
But none of it made a difference. Some of the attempts in combination. I feel like the underlying issue is much simpler.
Solved.
A very long time ago, I had a dependency pulled in, which required me to add the following inside the android block of my app's build.gradle
. Without it, I was unable to generate a signed bundle for release.
packagingOptions.resources.excludes += [
"**/*.proto",
"**/*.bin",
"**/*.java",
"**/*.properties",
"**/*.version",
"**/*.*_module",
"META-INF/AL2.0",
"META-INF/LGPL2.1",
]
The dependency since has been updated (/fixed) and I don't require any of the excludes anymore to generate a signed bundle. Looks like one of the excludes messed with the information required for Android Studio to correctly interpret "workers".