Fixed
Status Update
Comments
su...@google.com <su...@google.com> #2
Thanks for the report!
Could you please confirm for us which version of Compose is your project using? Does it happen if you change the version?
Relevant crash from device:
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A NOTE: Function names and BuildId information is missing for some frames due
NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
NOTE: found under the lib/ directory are readable.
NOTE: On this device, run setenforce 0 to make the libraries readable.
NOTE: Unreadable libraries:
NOTE: /data/data/com.app.work/cache/androidx.compose.ui-ui-1.2.0-rc03-inspector.jar_unpacked_lib/libcompose_inspection_jni.so
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A #00 pc 000000000004b5bc /apex/com.android.runtime/lib64/bionic/libc.so (__strncmp_aarch64+252) (BuildId: 058e3ec96fa600fb840a6a6956c6b64e)
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A #01 pc 00000000000028f4 /data/data/com.app.work/cache/androidx.compose.ui-ui-1.2.0-rc03-inspector.jar_unpacked_lib/libcompose_inspection_jni.so (compose_inspection::analyzeLines(_jvmtiEnv*, int, _jvmtiLineNumberEntry*, int, _jvmtiLocalVariableEntry*, int*, int*)+160) (BuildId: 0990d56fd5c4090102a504def1e5a1657300399e)
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A #02 pc 0000000000002eb4 /data/data/com.app.work/cache/androidx.compose.ui-ui-1.2.0-rc03-inspector.jar_unpacked_lib/libcompose_inspection_jni.so (compose_inspection::resolveLocation(_JNIEnv*, _jclass*)+840) (BuildId: 0990d56fd5c4090102a504def1e5a1657300399e)
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A #03 pc 0000000000440154 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 5de55fd6e2a9191dd8c1362ea79ef5f6)
2022-07-05 03:42:05.712 13983-13983 DEBUG pid-13983 A #04 pc 000000000044049c /apex/com.android.art/lib64/libart.so (BuildId: 5de55fd6e2a9191dd8c1362ea79ef5f6)
2022-07-05 03:42:05.730 771-771 tombstoned tombstoned E Tombstone written to: tombstone_09
su...@google.com <su...@google.com> #3
I can confirm same crash
composeVersion = '1.2.0-beta03'
+ these deps included
debugImplementation "androidx.compose.ui:ui-tooling:$composeVersion"
debugImplementation "androidx.compose.ui:ui-tooling-preview:$composeVersion"
debugImplementation "androidx.customview:customview:1.2.0-alpha01"
debugImplementation "androidx.customview:customview-poolingcontainer:1.0.0-rc01"
also tested 1.2.0-beta02, 1.3.0-alpha01 (with 1.2.0 composeCompiler)..., same crash
composeVersion = '1.2.0-beta03'
+ these deps included
debugImplementation "androidx.compose.ui:ui-tooling:$composeVersion"
debugImplementation "androidx.compose.ui:ui-tooling-preview:$composeVersion"
debugImplementation "androidx.customview:customview:1.2.0-alpha01"
debugImplementation "androidx.customview:customview-poolingcontainer:1.0.0-rc01"
also tested 1.2.0-beta02, 1.3.0-alpha01 (with 1.2.0 composeCompiler)..., same crash
Description
Version used: 1.0.0-alpha12
Devices/Android versions reproduced on: Pixel 2 Emulator
Canceling work that is deeper in the chain (by tag) seems to cancel the work correctly, but it get enqueued again incorrectly.
DownloadCommentsWorker:
```
override fun doWork(): Result {
System.out.println("$this::class.java - Started")
Thread.sleep(Random.nextLong(5000))
System.out.println("$this::class.java - Done")
return Result.success()
}
```
FinalWorker:
```
override fun doWork(): Result {
System.out.println("ALL WORK COMPLETE")
return Result.success()
}
```
```
WorkManager.getInstance()
.beginUniqueWork("unique", ExistingWorkPolicy.KEEP, OneTimeWorkRequestBuilder<DownloadCommentsWorker>().build())
.then(OneTimeWorkRequestBuilder<FinalWorker>().addTag("finally").build())
.enqueue()
WorkManager.getInstance().getWorkInfosForUniqueWorkLiveData("unique").observe(this, workInfos -> {
for (WorkInfo info : workInfos) {
System.out.println(info.toString());
}
});
WorkManager.getInstance().cancelAllWorkByTag("finally").getState().observe(this, state -> {
System.out.println(state);
});
```
Console Output
```
2018-12-11 11:04:51.182 6991-6991/com.plangrid.android.devgrid I/System.out: SUCCESS
2018-12-11 11:04:51.184 6991-7056/com.plangrid.android.devgrid I/System.out: com.plangrid.android.workmanager.DownloadCommentsWorker@e5d859f::class.java - Started
2018-12-11 11:04:51.240 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=CANCELLED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:51.240 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=RUNNING, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
2018-12-11 11:04:54.488 6991-7056/com.plangrid.android.devgrid I/System.out: com.plangrid.android.workmanager.DownloadCommentsWorker@e5d859f::class.java - Done
2018-12-11 11:04:54.508 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=ENQUEUED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:54.509 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
2018-12-11 11:04:54.518 6991-7057/com.plangrid.android.devgrid I/System.out: ALL WORK COMPLETE
2018-12-11 11:04:54.528 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='4eac7884-3374-494a-a549-fcd7505fc5b4', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[finally, com.plangrid.android.workmanager.FinalWorker]}
2018-12-11 11:04:54.528 6991-6991/com.plangrid.android.devgrid I/System.out: WorkInfo{mId='c8e75590-8f60-40b7-a2e6-4e7aa6e7830d', mState=SUCCEEDED, mOutputData=androidx.work.Data@0, mTags=[com.plangrid.android.workmanager.DownloadCommentsWorker]}
```