Status Update
Comments
da...@google.com <da...@google.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
ei...@gmail.com <ei...@gmail.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
da...@gmail.com <da...@gmail.com> #4
-
Second crash in the description is from a real device. Experienced it myself on two different Xiaomi phones, plus lots of crashes from users in the Google Play console.
-
Dynamic features are not used in the application.
As a wild guess, I have downgraded build tools from 31.0.0 to 30.0.3, compileSdk from 31 to 30, and moved all work with Language ID to the service in a separate process (just to be sure that crash can kill secondary process instead of main). This combination is in beta for 2 days by now and I don't see any SIGSEGV crashes.
ja...@gmail.com <ja...@gmail.com> #5
Hmm, I feel the crash might be something related to separate/secondary process.
I also changed compileSdk and targetSDK to 31 but still cannot repro this issue.
da...@google.com <da...@google.com> #6
On the contrary, there was no separate process before, when crashes started.
In the new build (with the aforementioned changes) I can see SIGSEGV crash, but only one instead of dozens and it has a bit different backtrace:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
liblanguage_id_jni.so (offset 0x11e000)
backtrace:
#00 pc 000000000003c7c0 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003b960 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bb48 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bafc /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000036c98 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000032714 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000031cac /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000057438 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/oat/arm64/base.odex (offset 0x57000)
ra...@gmail.com <ra...@gmail.com> #7
FYI, ML Kit launched a new language ID SDK in the latest release, which uses a new language ID model.
Could you try the new SDK version(17.0.0) to check if you can still repro this native crash? Thanks!
ei...@gmail.com <ei...@gmail.com> #8
Thank you, I'll try it and check.
sa...@softwarejourneys.co <sa...@softwarejourneys.co> #9
Hello. I have similar experience.
- I'm using mlkit-language 16.1.1
- I didnot meet this error until using AGP 4.2
- I can get this error since using AGP 7.0
- This error raised on Release build only(minimized by R8)
- This error raised without obfuscation.
ro...@gmail.com <ro...@gmail.com> #11
I created reproducible project.
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp7 mlkit_agp7
$ cd mlkit_agp7
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
$ adb logcat -b crash -d
10-19 19:41:49.844 17810 17810 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf9d733c in tid 17810 (e.myapplication), pid 17810 (e.myapplication)
10-19 19:41:50.473 17849 17849 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-19 19:41:50.473 17849 17849 F DEBUG : Build fingerprint: 'google/crosshatch/crosshatch:12/SPB5.210812.002/7671067:user/release-keys'
10-19 19:41:50.473 17849 17849 F DEBUG : Revision: 'MP1.0'
10-19 19:41:50.473 17849 17849 F DEBUG : ABI: 'arm64'
10-19 19:41:50.473 17849 17849 F DEBUG : Timestamp: 2021-10-19 19:41:49.903736988+0900
10-19 19:41:50.473 17849 17849 F DEBUG : Process uptime: 0s
10-19 19:41:50.473 17849 17849 F DEBUG : Cmdline: com.example.myapplication
10-19 19:41:50.474 17849 17849 F DEBUG : pid: 17810, tid: 17810, name: e.myapplication >>> com.example.myapplication <<<
10-19 19:41:50.474 17849 17849 F DEBUG : uid: 10240
10-19 19:41:50.474 17849 17849 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf9d733c
10-19 19:41:50.474 17849 17849 F DEBUG : x0 0000000000000000 x1 00000000000008fc x2 0000007a76760c71 x3 0000000000000000
10-19 19:41:50.474 17849 17849 F DEBUG : x4 0000000000000010 x5 0000007ba4db49d0 x6 0000007b34dc3680 x7 3de38e3900000608
10-19 19:41:50.474 17849 17849 F DEBUG : x8 0000007bb4dbedf0 x9 0000007acf9db2aa x10 0000000000000000 x11 0000007acf9d6640
10-19 19:41:50.474 17849 17849 F DEBUG : x12 0000000000000009 x13 0000000000000000 x14 0000000000000061 x15 00000000ebad6a89
10-19 19:41:50.474 17849 17849 F DEBUG : x16 0000007a767cfef8 x17 0000007d9a564b40 x18 0000007da3830000 x19 0000007feaf56a08
10-19 19:41:50.474 17849 17849 F DEBUG : x20 0000000000000000 x21 0000007ba4da50b0 x22 0000007bb4dbedf0 x23 0000007ba4da50b8
10-19 19:41:50.474 17849 17849 F DEBUG : x24 0000000000000009 x25 000000000000067e x26 0000000000000012 x27 0000000000000008
10-19 19:41:50.474 17849 17849 F DEBUG : x28 0000007b64dc8440 x29 0000000000000000
10-19 19:41:50.474 17849 17849 F DEBUG : lr 0000007a7678a964 sp 0000007feaf56810 pc 0000007a7678b7c0 pst 0000000060000000
10-19 19:41:50.474 17849 17849 F DEBUG : backtrace:
10-19 19:41:50.474 17849 17849 F DEBUG : #00 pc 000000000003c7c0 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #01 pc 000000000003b960 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #02 pc 000000000003bb48 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #03 pc 000000000003bafc /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #04 pc 0000000000036c98 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #05 pc 00000000000324a4 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #06 pc 0000000000031b5c /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (Java_com_google_mlkit_nl_languageid_internal_LanguageIdentificationJni_nativeIdentifyLanguage+100) (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
But after downgrade to AGP 4.2, crash is not reproducible.
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp42 mlkit_agp42
$ cd mlkit_agp42
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
Also, I tried to disable
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp7_r8_disable_inline_optimizer mlkit_agp7_r8
$ cd mlkit_agp7_r8
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
da...@google.com <da...@google.com> #12
I tried the repro steps but got a NPE when I run ./gradlew :app:pPRUA
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException
> java.lang.NullPointerException (no error message)
Could you also check if this is reproducible on 17.0.0
or 17.0.1
? If yes, could you attach the full log that I can take a look? Thanks!
da...@google.com <da...@google.com> #13
Here are gradle build scan logs for each branches.
All builds were clean build, and disabled build cache.
- mlkit_agp7 :
https://scans.gradle.com/s/qrymdqfzwokbq - mlkit_agp42 :
https://scans.gradle.com/s/b6644hzfyfhaw - mlkit_agp7_r8_disable_inline_optimizer :
https://scans.gradle.com/s/c6h5hy2nxod4u
Also, I pushed to update MLKit Language Id version 17.0.1 on
And here is crash log after apply 17.0.1
You can see that BuildId
of liblanguage_id_l2c_jni.so
was changed from 859ec0ec2000a39e6ae8ed42e1704f46
to be6e59455cc10135330c93acdebfc121
10-20 03:07:24.522 24587 24628 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf995426 in tid 24628 (pool-3-thread-3), pid 24587 (e.myapplication)
10-20 03:07:25.190 24710 24710 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-20 03:07:25.190 24710 24710 F DEBUG : Build fingerprint: 'google/crosshatch/crosshatch:12/SPB5.210812.002/7671067:user/release-keys'
10-20 03:07:25.190 24710 24710 F DEBUG : Revision: 'MP1.0'
10-20 03:07:25.190 24710 24710 F DEBUG : ABI: 'arm64'
10-20 03:07:25.190 24710 24710 F DEBUG : Timestamp: 2021-10-20 03:07:24.583346246+0900
10-20 03:07:25.190 24710 24710 F DEBUG : Process uptime: 0s
10-20 03:07:25.190 24710 24710 F DEBUG : Cmdline: com.example.myapplication
10-20 03:07:25.190 24710 24710 F DEBUG : pid: 24587, tid: 24628, name: pool-3-thread-3 >>> com.example.myapplication <<<
10-20 03:07:25.190 24710 24710 F DEBUG : uid: 10240
10-20 03:07:25.190 24710 24710 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf995426
10-20 03:07:25.190 24710 24710 F DEBUG : x0 0000007b54da9d30 x1 0000007d9a5fe7cc x2 0000000000000000 x3 0000000000000010
10-20 03:07:25.190 24710 24710 F DEBUG : x4 0000000000000000 x5 0000007c34dbc79c x6 0000002f0000083b x7 000003c300002dd5
10-20 03:07:25.190 24710 24710 F DEBUG : x8 0000000000000001 x9 0000000000000004 x10 0000000000000010 x11 0000000000000000
10-20 03:07:25.190 24710 24710 F DEBUG : x12 0000000000000000 x13 000000000000217e x14 0000007acf9932a8 x15 000000000000217e
10-20 03:07:25.190 24710 24710 F DEBUG : x16 0000000000000000 x17 0000007d9a564c78 x18 0000007a6ef18000 x19 0000007c34dbc580
10-20 03:07:25.190 24710 24710 F DEBUG : x20 0000007ca4dc7170 x21 0000007ca4dc7800 x22 0000007ca4dc71e0 x23 0000000000000000
10-20 03:07:25.190 24710 24710 F DEBUG : x24 0000000000000018 x25 0000000000000007 x26 0000000000000006 x27 0000000000000004
10-20 03:07:25.190 24710 24710 F DEBUG : x28 0000007ca4dc7090 x29 0000007cb4da9940
10-20 03:07:25.190 24710 24710 F DEBUG : lr 0000007a770a9624 sp 0000007a6f7de9c0 pc 0000007a770a96a8 pst 0000000020000000
10-20 03:07:25.190 24710 24710 F DEBUG : backtrace:
10-20 03:07:25.190 24710 24710 F DEBUG : #00 pc 00000000000386a8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #01 pc 00000000000388a0 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #02 pc 00000000000844a0 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #03 pc 000000000008783c /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #04 pc 0000000000035fc4 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #05 pc 0000000000034954 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #06 pc 00000000000340e8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (Java_com_google_mlkit_nl_languageid_internal_ThickLanguageIdentifier_nativeIdentifyPossibleLanguages+108) (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.191 24710 24710 F DEBUG : #07 pc 00000000002d9a44 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #08 pc 000000000020a700 /apex/com.android.art/lib64/libart.so (nterp_helper+5648) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #09 pc 00000000000cd0dc /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #10 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #11 pc 00000000000ccfa8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #12 pc 0000000000557cb4 /system/framework/arm64/boot-framework.oat (android.os.Binder.transact+148) (BuildId: 43a571a0ad85d6451b47016336a541ecb0eb12bb)
10-20 03:07:25.191 24710 24710 F DEBUG : #13 pc 000000000020b53c /apex/com.android.art/lib64/libart.so (nterp_helper+9292) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #14 pc 00000000000b7aba /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #15 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #16 pc 00000000000a7496 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #17 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #18 pc 00000000000a7360 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #19 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #20 pc 000000000009e46c /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #21 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #22 pc 00000000000d33d6 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #23 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #24 pc 000000000009df0a /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #25 pc 0000000000209124 /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #26 pc 000000000009e350 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #27 pc 000000000037b9ac /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+988) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #28 pc 00000000003751d4 /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+68) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #29 pc 000000000020aec4 /apex/com.android.art/lib64/libart.so (nterp_helper+7636) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #30 pc 000000000009e370 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #31 pc 00000000001bf35c /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+76) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #32 pc 00000000002d0164 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #33 pc 000000000031ccac /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #34 pc 00000000003cf8a0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #35 pc 0000000000460894 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #36 pc 00000000000b1910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: ba489d4985c0cf173209da67405662f9)
10-20 03:07:25.191 24710 24710 F DEBUG : #37 pc 00000000000513f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ba489d4985c0cf173209da67405662f9)
ro...@gmail.com <ro...@gmail.com> #14
Cross-posted on R8 issue tracker.
ap...@google.com <ap...@google.com> #15
Hi,
Looks like we figured out the root cause in
For temporary workarounds for the existing SDKs, you need to add this rule
-keep class com.google.mlkit.nl.languageid.internal.LanguageIdentificationJni { *; }
for language-id 16.1.1
, and add this rule
-keep class com.google.mlkit.nl.languageid.internal.ThickLanguageIdentifier { *; }
for version language-id 17.0.0+
for the newer model.
We'll fix this issue in the upcoming release so that you'll not need these workarounds in the future release.
Thanks a lot for reporting this issue!
da...@google.com <da...@google.com> #16
Added workarounds in
ma...@gmail.com <ma...@gmail.com> #17
an...@gmail.com <an...@gmail.com> #18
Hi! I'm still waiting for a quick solution to the problems generated in iOS
This is my data:
kotlin = "2.0.0" room = "2.7.0-alpha06" ksp = "2.0.0-1.0.21" sqlite = "2.5.0-SNAPSHOT"
import com.google.devtools.ksp.gradle.KspTaskMetadata import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.jetbrainsCompose) alias(libs.plugins.compose.compiler) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.ksp) alias(libs.plugins.room) }
kotlin { androidTarget { @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { iosTarget -> iosTarget.binaries.framework { baseName = "ComposeApp" isStatic = true linkerOpts.add("-lsqlite3") } }
sourceSets {
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.core.splashscreen)
implementation(libs.ktor.client.okhttp)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.xml.util.core.android)
implementation(libs.room.runtime.android)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.bundles.ktor)
api(libs.datastore.preferences)
api(libs.datastore)
api(libs.koin.core)
implementation(libs.koin.compose)
implementation(libs.koin.compose.viewmodel)
implementation(libs.lifecycle.viewmodel)
implementation(libs.navigation.compose)
implementation(libs.xml.util.core)
implementation(libs.xml.util.serialization)
implementation(libs.room.runtime)
implementation(libs.sqlite.bundled)
}
nativeMain.dependencies {
implementation(libs.ktor.client.darwin)
}
sourceSets.commonMain {
kotlin.srcDir("build/generated/ksp/metadata")
}
}
}
android { namespace = "com.itlab.match_academico" compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig {
applicationId = "com.itlab.match_academico"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
}
dependencies {
debugImplementation(compose.uiTooling)
}
}
room { schemaDirectory("$projectDir/schemas") }
dependencies { add("kspCommonMainMetadata", libs.room.compiler) add("kspAndroid", libs.room.compiler) afterEvaluate { add("kspIosSimulatorArm64", libs.room.compiler) add("kspIosX64", libs.room.compiler) add("kspIosArm64", libs.room.compiler) } }
kotlin.sourceSets.commonMain { tasks.withType<KspTaskMetadata> { kotlin.srcDir(destinationDirectory) } }
My db:
package features.configIni.data.database
import androidx.room.ConstructedBy import androidx.room.Database import androidx.room.RoomDatabase import androidx.room.RoomDatabaseConstructor
@Database( entities = [ WebServiceRoom::class ], version = 1 ) @ConstructedBy(WebServiceDatabaseConstructor::class) abstract class WebServiceDatabase: RoomDatabase() { abstract fun webserviceDao(): WebServiceDao }
expect object WebServiceDatabaseConstructor : RoomDatabaseConstructor<WebServiceDatabase>
const val DATABASE_NAME = "webService.db"
On Android, everything works fine but on iOS I get the error:
Expected WebServiceDatabaseConstructor has no actual declaration in module
when according to the official doc it does not require me to set the actual declaration
ya...@gmail.com <ya...@gmail.com> #19
I was able to build both Android/iOS with room = "2.7.0-alpha06".
I had to change composeApp/build.gradle.kts.
Solution
// libs.versions.toml
[versions]
kotlin = "2.0.10"
roomVersion = "2.7.0-alpha06"
sqlite = "2.5.0-alpha06"
ksp = "2.0.0-1.0.21"
[libraries]
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomVersion" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomVersion" }
sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sqlite" }
[plugins]
room = { id = "androidx.room", version.ref = "roomVersion" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
// composeApp/build.gradle.kts
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.Properties
plugins {
...
// room
alias(libs.plugins.ksp)
alias(libs.plugins.room)
}
kotlin {
...
sourceSets {
...
iosMain {
// To provide RoomDatabaseConstructor actual declaration
kotlin.srcDir("build/generated/ksp/metadata")
dependencies {
...
}
}
}
}
dependencies {
...
// Room
add("kspCommonMainMetadata", libs.androidx.room.compiler)
add("kspAndroid", libs.androidx.room.compiler)
}
room {
schemaDirectory("$projectDir/schemas")
}
Create the following classes according to the official documentation.
- shared/src/commonMain/kotlin/Database.kt
- shared/src/androidMain/kotlin/Database.kt
- shared/src/iosMain/kotlin/Database.kt
Build
- Android Studio > Build > Clean Project
- Android Studio > Build > Rebuild Project
vi...@gmail.com <vi...@gmail.com> #20
#libs.version.toml
...
ksp = "2.0.0-1.0.21" # "1.9.23-1.0.19"
androidx-room = "2.7.0-alpha06" #2.7.0-alpha04" #"2.7.0-alpha01"
...
#shared/build.gradle.kts
plugins {
...
alias(libs.plugins.ksp)
alias(libs.plugins.room)
...
}
kotlin {
...
sourceSets {
...
iosMain {
kotlin.srcDir("build/generated/ksp/metadata")
dependencies {
...
}
}
}
}
dependencies {
// "kspAndroid"(libs.androidx.room.compiler) // For AndroidUnitTest
// "kspCommonMainMetadata"(libs.androidx.room.compiler)
add("kspCommonMainMetadata", libs.androidx.room.compiler)
add("kspAndroid", libs.androidx.room.compiler)
add("kspIosSimulatorArm64", libs.androidx.room.compiler)
add("kspIosX64", libs.androidx.room.compiler)
add("kspIosArm64", libs.androidx.room.compiler)
}
#ZDCKeyCoreDatabase.kt
@Database(entities = [UserEntity::class], version = KMPConstants.DATABASE_VERSION, exportSchema = true)
@ConstructedBy(ZDCKeyCoreDatabaseConstructor::class)
abstract class ZDCKeyCoreDatabase : RoomDatabase() {
abstract fun getUserDao(): UserDao
}
@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
expect object ZDCKeyCoreDatabaseConstructor: RoomDatabaseConstructor<ZDCKeyCoreDatabase>
But the build is getting failed with below error.
e:file:///Users/..../kmp_project/zdckey_core/build/generated/ksp/metadata/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabaseConstructor.kt:5:22 'actual object ZDCKeyCoreDatabaseConstructor : RoomDatabaseConstructor<ZDCKeyCoreDatabase>' has no corresponding expected declaration
e:file:///Users/..../kmp_project/zdckey_core/build/generated/ksp/metadata/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabaseConstructor.kt:5:22 ZDCKeyCoreDatabaseConstructor: expect and corresponding actual are declared in the same module.
e: file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:23:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:23:15 ZDCKeyCoreDatabaseConstructor: expect and corresponding actual are declared in the same module
Suggestions to solve this issue would be highly appreciated. Thanks in advance.
da...@google.com <da...@google.com> #21
Since this have changed a between alpha05 and alpha06 (and alpha07), please double check your build Gradle file configuration.
- Please apply it to all your 'end' targets (this list is exhaustive but only use the ones relevant to your project):
dependencies {
// Android
add("kspAndroid", libs.androidx.room.compiler)
// JVM (Desktop)
add("kspJvm", libs.androidx.room.compiler)
// Linux
add("kspLinuxX64", libs.androidx.room.compiler)
add("kspLinuxArm64", libs.androidx.room.compiler)
// Mac
add("kspMacosX64", libs.androidx.room.compiler)
add("kspMacosArm64", libs.androidx.room.compiler)
// iOS
add("kspIosSimulatorArm64", libs.androidx.room.compiler)
add("kspIosX64", libs.androidx.room.compiler)
add("kspIosArm64", libs.androidx.room.compiler)
}
Note that applying the processor to the kspCommonMainMetadata
should not be needed.
- Do not manually add KSP generated sources from other targets:
// DO NOT DO THIS
iosMain {
kotlin.srcDir("build/generated/ksp/metadata")
}
This just leads to errors due to the differences of generated code between the platforms, which is why its important that on step 1 the Room KSP processor is applied to all targets that will use the common sources set where the @Database
is defined.
- Do not declare explicit task dependencies:
// DO NOT DO THIS
kotlin.sourceSets.commonMain {
tasks.withType<KspTaskMetadata> {
kotlin.srcDir(destinationDirectory)
}
}
Declaring direct dependencies and adding generated sources by KSP is a red flag, these where workarounds from alpha05 that shouldn't be needed with the newer @ConstructedBy
strategy in alpha06.
- Do not create the
actual
of theexpect object
class that implementedRoomDatabaseConstructor
// shared/src/commonMain/kotlin/Database.kt
expect object MyDatabaseCtor: RoomDatabaseConstructor<MyDatabaseCtor> {
fun initialize(): MyDatabaseCtor
}
// shared/src/nativeMain/kotlin/Database.kt
// DO NOT DO THIS
actual object MyDatabaseCtor: RoomDatabaseConstructor<MyDatabaseCtor> {
fun initialize(): MyDatabaseCtor { ... }
}
-
Make sure Kotlin version matches KSP version, i.e. if using Kotlin 2.0.10 then use KSP 2.0.10-1.0.24
-
If using Kotlin 2.x then the
kotlin.native.disableCompilerDaemon = true
is not needed and can lead to another issue (https://youtrack.jetbrains.com/issue/KT-69523 ). -
If you are using the Compose Gradle Plugin and Room Gradle Plugin along with Kotlin 2.0 then you might see a separate issue regarding the plugins along the lines of
Cannot change attributes of configuration ':<project>:debugFrameworkIosX64' after it has been locked for mutation
, the workaround is to remove the Room Gradle Plugin and configure the schema directory via KSP arguments, seehttps://issuetracker.google.com/343408758 -
If you had the workaround for
clearAllTables()
, please remove it, it is no needed since Room is being applied to 'end' targets.
Feel free to comment even if the steps mentioned here don't work for you.
vi...@gmail.com <vi...@gmail.com> #22
Thanks a lot for the quick response and clarifying all the confusions.
All the mentioned checklist are verified. But the build fails with the following error.
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:22:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
#ZDCKeyCoreDatabase.kt
@Database(entities = [UserEntity::class], version = KMPConstants.DATABASE_VERSION, exportSchema = true)
@ConstructedBy(ZDCKeyCoreDatabaseConstructor::class)
abstract class ZDCKeyCoreDatabase : RoomDatabase() {
abstract fun getUserDao(): UserDao
}
expect object ZDCKeyCoreDatabaseConstructor: RoomDatabaseConstructor<ZDCKeyCoreDatabase>
Kindly share us the solution. Thanks in advance..
an...@gmail.com <an...@gmail.com> #23
I just followed the suggestions of
null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
These are my classes
@Database( entities = [ WebServiceRoom::class ], version = 1 ) @ConstructedBy(WebServiceDatabaseConstructor::class) abstract class WebServiceDatabase: RoomDatabase() { abstract fun webserviceDao(): WebServiceDao }
expect object WebServiceDatabaseConstructor : RoomDatabaseConstructor<WebServiceDatabase>
const val DATABASE_NAME = "webService.db"
Ios: fun getWebServicesDatabase(): RoomDatabase.Builder<WebServiceDatabase>{ val dbFilePath = documentDirectory() + "/$DATABASE_NAME" return Room.databaseBuilder<WebServiceDatabase>( name = dbFilePath, ) }
@OptIn(ExperimentalForeignApi::class) private fun documentDirectory(): String { val documentDirectory = NSFileManager.defaultManager.URLForDirectory( directory = NSDocumentDirectory, inDomain = NSUserDomainMask, appropriateForURL = null, create = false, error = null, ) return requireNotNull(documentDirectory?.path) }
import database.getWebServicesDatabase import features.configIni.data.datasource.ConfigIniService import io.ktor.client.engine.darwin.Darwin import networking.createHttpClient import org.koin.dsl.module
actual val platformModule = module { single { createHttpClient(Darwin.create()) } single { ConfigIniService(get()) } single { getWebServicesDatabase() } }
Gradle: import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.jetbrainsCompose) alias(libs.plugins.compose.compiler) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.ksp) alias(libs.plugins.room) }
kotlin { androidTarget { @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { iosTarget -> iosTarget.binaries.framework { baseName = "ComposeApp" isStatic = true linkerOpts.add("-lsqlite3") } }
sourceSets {
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.core.splashscreen)
implementation(libs.ktor.client.okhttp)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.xml.util.core.android)
implementation(libs.room.runtime.android)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.bundles.ktor)
api(libs.datastore.preferences)
api(libs.datastore)
api(libs.koin.core)
implementation(libs.koin.compose)
implementation(libs.koin.compose.viewmodel)
implementation(libs.lifecycle.viewmodel)
implementation(libs.navigation.compose)
implementation(libs.xml.util.core)
implementation(libs.xml.util.serialization)
implementation(libs.room.runtime)
implementation(libs.sqlite.bundled)
}
iosMain {
dependencies{
implementation(libs.ktor.client.darwin)
}
}
}
}
android { namespace = "com.itlab.match_academico" compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig {
applicationId = "com.itlab.match_academico"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
compose = true
}
dependencies {
debugImplementation(compose.uiTooling)
}
}
room { schemaDirectory("$projectDir/schemas") }
dependencies { // Android add("kspAndroid", libs.room.compiler) // iOS add("kspIosSimulatorArm64", libs.room.compiler) add("kspIosX64", libs.room.compiler) add("kspIosArm64", libs.room.compiler) }
kotlin = "2.0.10" room = "2.7.0-alpha06" ksp = "2.0.0-1.0.21" sqlite = "2.5.0-SNAPSHOT"
kotlin.code.style=official
#Gradle org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
#Android android.nonTransitiveRClass=true android.useAndroidX=true
#Kotlin Multiplatform kotlin.mpp.enableCInteropCommonization=true
#Room kotlin.native.disableCompilerDaemon = true ksp.useKSP2=true
da...@google.com <da...@google.com> #24
If you are using Kotlin 2.0.10
please make sure you use matching KSP version 2.0.10-1.0.24
If you encounter an error with Cannot change attributes of configuration ':<project>:debugFrameworkIosX64' ...
then please see the workaround in
da...@google.com <da...@google.com> #25
Another important thing is that kotlin.native.disableCompilerDaemon = true
is not needed when using Kotlin 2.0.10, having it enable will lead to a different issue:
an...@gmail.com <an...@gmail.com> #26
Thank you very much for the prompt response, I really appreciate it!
I corrected your observations and I still have the same error in iOS Xcode,these are the logs I receive when I do the clean rebuild. I attached two images for a better look. Thanks for the support.
ma...@gmail.com <ma...@gmail.com> #27
Thanks! These steps helped me fix Android and iOS. JVM is giving issues: Configuration with name 'kspJvm' not found.
vi...@gmail.com <vi...@gmail.com> #28
Let me clarify something.. The room for client applications works properly when integrated with kmp library in local. i.e when using it as a whole/same project. But We would like to host library as a separate sdk.
I don't know how it is working for client applications. When we build the shared module(kmp) as standalone it shows error. But when we create new Android module within the project and access it from there it runs properly.
CASE: 1 //works fine
Project [
module1 = Android
module2 = kmp library
]
Shows compile error in module2 database file but while running the android application, all the room operations works fine.
CASE: 2 // our use case
Project [
module1 = kmp library
]
Build fails with the error saying 'The constructor is not abstract and does not implement abstract member initialize'.
We need to generate executables and host it as an sdk.
Kindly consider this use-case and provide us the solution.
Detailed error description:
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:21:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
an...@gmail.com <an...@gmail.com> #29
an...@gmail.com <an...@gmail.com> #30
Hello again
I corrected your observations and I still have the same error in iOS Xcode,these are the logs I receive when I do the clean rebuild. My error is: null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
I attached two images for a better look. Thanks for the support.
da...@google.com <da...@google.com> #31
re ./gradlew :composeApp:kspKotlinIosX64 --stacktrace
? The error null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
is new and might not be relevant to this specific bug.
vi...@gmail.com <vi...@gmail.com> #32
Our usecase is to generate aar and xcframework files from a standalone kmp library without any other android or ios modules.
Project [
module1 = kmp library
]
Detailed error description:
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:21:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
Is there any solutions for this usecase..! Kindly suggest any workaround. Thanks in advance..
an...@gmail.com <an...@gmail.com> #33
an...@gmail.com <an...@gmail.com> #34
re
This is the full stacktrace:
% ./gradlew :composeApp:kspKotlinIosX64 --stacktrace Type-safe project accessors is an incubating feature.
Task :composeApp:kspKotlinIosX64 FAILED e: [ksp] java.lang.NullPointerException: null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':composeApp:kspKotlinIosX64'. A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':composeApp:kspKotlinIosX64'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130) at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:128) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314) at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47) Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.google.devtools.ksp.gradle.KspAAWorkerAction at org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:287) at org.gradle.internal.work.DefaultAsyncWorkTracker.lambda$waitForItemsAndGatherFailures$2(DefaultAsyncWorkTracker.java:130) at org.gradle.internal.Factories$1.create(Factories.java:31) at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:336) at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:319) at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLock(DefaultWorkerLeaseService.java:324) at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:126) at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:92) at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForAll(DefaultAsyncWorkTracker.java:78) at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:66) at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:252) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68) at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:229) at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:212) at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:195) at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:162) at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105) at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59) at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55) at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50) at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:67) at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:37) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26) at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:67) at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:45) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:40) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:29) at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189) at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:75) at org.gradle.internal.Either$Right.fold(Either.java:175) at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:62) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73) at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:46) at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:35) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:76) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:54) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27) at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:49) at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:27) at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:71) at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:39) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:65) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:36) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106) at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:55) at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:64) at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:43) at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:125) at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:61) at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36) at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23) at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75) at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41) at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35) at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:289) at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31) at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22) at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40) at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23) at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:67) at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:67) at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:39) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:46) at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:34) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:48) at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35) at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:61) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:127) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:116) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314) at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47) Caused by: java.lang.NullPointerException: null cannot be cast to non-null type org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl at com.google.devtools.ksp.impl.symbol.kotlin.UtilKt.getDefaultValue(util.kt:590) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl$defaultArguments$2.invoke(KSAnnotationResolvedImpl.kt:88) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl$defaultArguments$2.invoke(KSAnnotationResolvedImpl.kt:64) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl.getDefaultArguments(KSAnnotationResolvedImpl.kt:64) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl$arguments$2.invoke(KSAnnotationResolvedImpl.kt:57) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl$arguments$2.invoke(KSAnnotationResolvedImpl.kt:54) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.google.devtools.ksp.impl.symbol.kotlin.resolved.KSAnnotationResolvedImpl.getArguments(KSAnnotationResolvedImpl.kt:54) at com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl$annotations$2$4.invoke(KSPropertyDeclarationImpl.kt:76) at com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl$annotations$2$4.invoke(KSPropertyDeclarationImpl.kt:72) at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:171) at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:331) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:318) at kotlin.sequences.SequencesKt___SequencesKt.any(_Sequences.kt:1240) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitAnnotated(CollectAnnotatedSymbolsVisitor.kt:37) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitPropertyDeclaration(CollectAnnotatedSymbolsVisitor.kt:82) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitPropertyDeclaration(CollectAnnotatedSymbolsVisitor.kt:33) at com.google.devtools.ksp.impl.symbol.kotlin.KSPropertyDeclarationImpl.accept(KSPropertyDeclarationImpl.kt:189) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitClassDeclaration(CollectAnnotatedSymbolsVisitor.kt:54) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitClassDeclaration(CollectAnnotatedSymbolsVisitor.kt:33) at com.google.devtools.ksp.impl.symbol.kotlin.KSClassDeclarationImpl.accept(KSClassDeclarationImpl.kt:175) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitFile(CollectAnnotatedSymbolsVisitor.kt:43) at ksp.com.google.devtools.ksp.common.visitor.CollectAnnotatedSymbolsVisitor.visitFile(CollectAnnotatedSymbolsVisitor.kt:33) at com.google.devtools.ksp.impl.symbol.kotlin.KSFileImpl.accept(KSFileImpl.kt:84) at com.google.devtools.ksp.impl.ResolverAAImpl.collectAnnotatedSymbols(ResolverAAImpl.kt:629) at com.google.devtools.ksp.impl.ResolverAAImpl.access$collectAnnotatedSymbols(ResolverAAImpl.kt:84) at com.google.devtools.ksp.impl.ResolverAAImpl$newAnnotatedSymbols$2.invoke(ResolverAAImpl.kt:640) at com.google.devtools.ksp.impl.ResolverAAImpl$newAnnotatedSymbols$2.invoke(ResolverAAImpl.kt:639) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.google.devtools.ksp.impl.ResolverAAImpl.getNewAnnotatedSymbols(ResolverAAImpl.kt:639) at com.google.devtools.ksp.impl.ResolverAAImpl.getSymbolsWithAnnotation(ResolverAAImpl.kt:621) at com.google.devtools.ksp.processing.Resolver.getSymbolsWithAnnotation$default(Resolver.kt:48) at androidx.room.compiler.processing.ksp.KspRoundEnv.getElementsAnnotatedWith(KspRoundEnv.kt:53) at androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:95) at androidx.room.compiler.processing.ksp.KspBasicAnnotationProcessor.process(KspBasicAnnotationProcessor.kt:62) at com.google.devtools.ksp.impl.KotlinSymbolProcessing.execute(KotlinSymbolProcessing.kt:538) at com.google.devtools.ksp.impl.KSPLoader$Companion.loadAndRunKSP(KSPLoader.kt:36) at com.google.devtools.ksp.impl.KSPLoader.loadAndRunKSP(KSPLoader.kt) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at com.google.devtools.ksp.gradle.KspAAWorkerAction.execute(KspAATask.kt:510) at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62) at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59) at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162) at org.gradle.internal.Factories$1.create(Factories.java:31) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:264) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:128) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:133) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126) ... 2 more Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to
BUILD FAILED in 2s 5 actionable tasks: 1 executed, 4 up-to-date
This is my build gradle
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.jetbrainsCompose) alias(libs.plugins.compose.compiler) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.ksp) alias(libs.plugins.room) }
kotlin { androidTarget { @OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { iosTarget -> iosTarget.binaries.framework { baseName = "ComposeApp" isStatic = true linkerOpts.add("-lsqlite3") } }
sourceSets {
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
implementation(libs.core.splashscreen)
implementation(libs.ktor.client.okhttp)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.xml.util.core.android)
implementation(libs.room.runtime.android)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.bundles.ktor)
api(libs.datastore.preferences)
api(libs.datastore)
api(libs.koin.core)
implementation(libs.koin.compose)
implementation(libs.koin.compose.viewmodel)
implementation(libs.lifecycle.viewmodel)
implementation(libs.navigation.compose)
implementation(libs.xml.util.core)
implementation(libs.xml.util.serialization)
implementation(libs.room.runtime)
implementation(libs.sqlite.bundled)
}
iosMain {
dependencies{
implementation(libs.ktor.client.darwin)
}
}
} }
android { namespace = "com.itlab.match_academico" compileSdk = libs.versions.android.compileSdk.get().toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") sourceSets["main"].res.srcDirs("src/androidMain/res") sourceSets["main"].resources.srcDirs("src/commonMain/resources")
defaultConfig { applicationId = "com.itlab.match_academico" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } buildTypes { getByName("release") { isMinifyEnabled = false } } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } buildFeatures { compose = true } dependencies { debugImplementation(compose.uiTooling) } }
room { schemaDirectory("$projectDir/schemas") }
dependencies { // Android add("kspAndroid", libs.room.compiler) // iOS add("kspIosSimulatorArm64", libs.room.compiler) add("kspIosX64", libs.room.compiler) add("kspIosArm64", libs.room.compiler) }
da...@google.com <da...@google.com> #35
re
re
vi...@gmail.com <vi...@gmail.com> #36
Below is the only error which we are facing.
Detailed error description:
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:21:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
The above error seems specific to the latest API change in alpha06. Actual implementations are generated by KSP in all the target sourcesets properly. But this error indicates that it expects implementation in commonmain too..
Kindly consider this error description and help us to find the root cause.. and the solution to fix it.
er...@gmail.com <er...@gmail.com> #37
e:file:///Users/..../kmp_project/zdckey_core/src/commonMain/kotlin/com/..../zdckey_core/data/database/ZDCKeyCoreDatabase.kt:21:8 Object 'ZDCKeyCoreDatabaseConstructor' is not abstract and does not implement abstract member 'initialize'.
Buddy. maybe you have some erros in ZDCKeyCoreDatabase.kt
.
You should not directly implement SDCKeyCoreDatabaseConstructor
. You let it be just expect object.
Can you upload the declaration of SDCKeyCoreDatabase
and implementation (in your case, it looks like you implement actual object) of ZDCKeyCoreDatabaseConstructor
?
vi...@gmail.com <vi...@gmail.com> #38
Nope.. brother, I didn't. I let the KSP to implement actuals in the respective target platforms and it did. i.e in androidMain and in iOSMain (in the build ->generated -> ksp folders obviously)
The problem here is as per the error description it seeks the implementation in commonMain where the expect object is defined. This is weird.
I hope the problem is clear now!
I will share the attachment for proof.
proof-1 will show the error description and the way i implemented ZDCCoreDatabase.
proof-2 will show that the actuals were generated by ksp in their respective target directories of build folder.
So please somebody look into the actual problem.. :).
er...@gmail.com <er...@gmail.com> #39
can I ask what proof_1.png
source is located in? It should be in commonMain
.
If you can find the auto-generated actual object, can you upload?
pr...@google.com <pr...@google.com> #40
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-common:2.7.0-alpha06
androidx.room:room-common-iosarm64:2.7.0-alpha06
androidx.room:room-common-iossimulatorarm64:2.7.0-alpha06
androidx.room:room-common-iosx64:2.7.0-alpha06
androidx.room:room-common-jvm:2.7.0-alpha06
androidx.room:room-common-linuxx64:2.7.0-alpha06
androidx.room:room-common-macosarm64:2.7.0-alpha06
androidx.room:room-common-macosx64:2.7.0-alpha06
androidx.room:room-compiler:2.7.0-alpha06
androidx.room:room-gradle-plugin:2.7.0-alpha06
androidx.room:room-runtime:2.7.0-alpha06
androidx.room:room-runtime-android:2.7.0-alpha06
androidx.room:room-runtime-iosarm64:2.7.0-alpha06
androidx.room:room-runtime-iossimulatorarm64:2.7.0-alpha06
androidx.room:room-runtime-iosx64:2.7.0-alpha06
androidx.room:room-runtime-jvm:2.7.0-alpha06
androidx.room:room-runtime-linuxx64:2.7.0-alpha06
androidx.room:room-runtime-macosarm64:2.7.0-alpha06
androidx.room:room-runtime-macosx64:2.7.0-alpha06
androidx.room:room-testing:2.7.0-alpha06
androidx.room:room-testing-android:2.7.0-alpha06
androidx.room:room-testing-iosarm64:2.7.0-alpha06
androidx.room:room-testing-iossimulatorarm64:2.7.0-alpha06
androidx.room:room-testing-iosx64:2.7.0-alpha06
androidx.room:room-testing-jvm:2.7.0-alpha06
androidx.room:room-testing-linuxx64:2.7.0-alpha06
androidx.room:room-testing-macosarm64:2.7.0-alpha06
androidx.room:room-testing-macosx64:2.7.0-alpha06
vi...@gmail.com <vi...@gmail.com> #41
Yes, of course it is located in commonMain.I haven't shared the package structure because it violates our org policy.
I will share the requested screenshots with blurred package names. Please check and let me know your thoughts..
vi...@gmail.com <vi...@gmail.com> #42
Hii pr...@google.com
I am not getting it.. We are already using 2.7.0-alpha06 only! which is where RoomDatabaseConstructor & @ConstructedBy annotation api's are introduced.
"It is possible this bug has only been partially addressed:"
Here you mean this usecase is missed in this version of release?. Kindly clarify us..
Is there any workaround?
da...@google.com <da...@google.com> #43
Here is a sample project using Kotlin 2.0, Compose KMP and Room KMP 2.7.0-alpha06 in a library module:
I hope it serves as guidance, otherwise without a small repro project it is hard for us to point you in the right direction to fix your issue. Let me know if it is helpful.
er...@gmail.com <er...@gmail.com> #44
In my opinion.. your compiler version doesn't support actual
/ expect
. Can you check your Kotlin, KSP, Compose Version and talk to me?
vi...@gmail.com <vi...@gmail.com> #45
Buddy, our compiler version does support expect & actual. We have expect actual implementations for network, datastore related apis in our project. The room constructedby API is the only problem we are facing.
If you ask for versions, we are using kotlin 2.0 and its compatible ksp version.
ha...@gmail.com <ha...@gmail.com> #46
Am facing the same error. Please took this as a priority. We are halfway into the release.
If it is an issue in this please let us know, we will look for alternatives for the time being. Kindly clarify us.
vi...@gmail.com <vi...@gmail.com> #47
Dear da...@google.com
Thanks a lot for taking time and build this sample project for us.
The mentioned issue reproduced in your project too. If we run the android application, it will run. But when we rebuild the project it will get failed throwing an error in the shared/library module.
e: file:///Users/.../Documents/RoomKmpLibraryExample/data/src/commonMain/kotlin/com/example/data/MyDatabase.kt:19:8 Object 'MyDatabaseCtor' is not abstract and does not implement abstract member 'initialize'.
In our use case we will not bind app and library modules in a same project. We will generate aar, xcframework files and host it in our org repository.
Attaching the screenshot for your reference.
Again, thanks for making the efforts. We sincerely appreciate it.
ph...@bayf.net <ph...@bayf.net> #48
After following all the guidance and checking the sample project I'm still getting: Object 'MyDatabaseCtor' is not abstract and does not implement abstract member 'initialize'
ma...@gmail.com <ma...@gmail.com> #49
er...@gmail.com <er...@gmail.com> #50
I have a similar error like yours when rebuild gradle.
'actual object AlarmDatabaseCtor : RoomDatabaseConstructor<AlarmDatabase>' has no corresponding expected declaration
However it works without error at my database.
da...@google.com <da...@google.com> #51
So it seems the issue is when either running ./gradlew build
or via Build -> Rebuild Project
in the IDE. This is important information since those actions tend to build 'too many things'. Specially it tries to build common source set in isolation (compileCommonMainKotlinMetadata
) which is a grey area in Kotlin right now, due to the expect / actual compilation model it is not possible to publish a 'common-only' library that has expect / actual as consumers can't contribute to those, i.e. you always publish -common
along side a platform.
I agree building via those two actions is broken. But are they hindering the rest of your project if iOS (via XCode), JVM Desktop (via ./gradlew composeApp:run
) and Android (via Android Studio) launch and work as expected? Or are they preventing you from publishing a library?
If it is still valuable to you to have a successful build via ./gradlew build
then we actually just made a fix for this (see initialize
override function in the expect object
and then the generated code will also include the actual
modifier. You can try this right now with a snapshot version of Room (see ./gradlew build
containing the fix in
ph...@bayf.net <ph...@bayf.net> #52
In my case, run via Android Studio, run via Xcode, Android CI (./gradlew build
) and iOS CI (xcodebuild archive
) are all broken with the same error. I've not managed to get a successful build to run with the latest alpha. It's a multi-module CMP project, it's virtually identical to your example project, in terms of Gradle and database initialisation, but with several entity types and DAOs added.
Edit: With snapshot, everything is working 👌🏻
vi...@gmail.com <vi...@gmail.com> #53
Thanks for the update da..@google.com. This is the clarity we want.. Some issue is found and it will be resolved in the next alpha release. This is the exact issue am trying to point out from beginning. As you mentioned this issue preventing us from publishing a library. I am glad this conversation has come to a conclusion. I sincerely appreciate your relentless response.
av...@gmail.com <av...@gmail.com> #54
From
on 8/15/2024: issue 358393367
re
Just one question, it seems to me that we can get XXDatabase info through the @Database annotation. I haven't seen the specific code, but I guess XXDatabase_Impl is also generated in this way? Is it possible generate expect object XXDatabaseConstructor : RoomDatabaseConstructor<XXDatabase>
automatally without any intervention?
av...@gmail.com <av...@gmail.com> #55
From
on 8/11/2024: issue 358913889
Update! Problems solved by doing things
- disable room gradle plugin and rewrite
ksp { .... }
as you mentioned. - update kotlin and ksp version to 2.0.10
I think this is just temporary solution, however anyway it works now. I hope next version of room should be fixed ... :) thanks for your help!
st...@gmail.com <st...@gmail.com> #56
an...@gmail.com <an...@gmail.com> #57
Hi, I encountered a similar problem running KMM iOS build (room+ksp) and was able to resolve it by updating the dependencies.
room = "2.7.0-alpha08"
ksp = "2.0.20-1.0.25"
compose-plugin = "1.6.11"
kotlin = "2.0.20"
Description
Version used:
androidxRoom = "2.7.0-alpha02"
sqlite = "2.5.0-alpha02"
ksp = "1.9.23-1.0.19"
kotlin = "1.9.23"
and 1 try
kotlin = "2.0.0"
ksp = "2.0.0-1.0.21"
Devices/Android versions reproduced on:
iOS
fun getDatabaseBuilder(): RoomDatabase.Builder<AppDatabase> {
val dbFilePath = NSHomeDirectory() + "/location-database.db"
return Room.databaseBuilder<AppDatabase>(
name = dbFilePath,
factory = { AppDatabase::class.instantiateImpl() }
).setDriver(BundledSQLiteDriver())
.setQueryCoroutineContext(Dispatchers.IO)
}
Unresolved reference: instantiateImpl
ksp has generated an extension function whose name is instantiateImpl, but the project is not going to be built.
Unresolved reference: instantiateImpl
suggests adding a dependency - Add dependency on module 'project.module.core.iosX64Main'