Status Update
Comments
mm...@commonsware.com <mm...@commonsware.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
lu...@gmail.com <lu...@gmail.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
ch...@google.com <ch...@google.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.
mm...@commonsware.com <mm...@commonsware.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.
[Deleted User] <[Deleted User]> #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)
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.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!
Description
Android Studio 3.5 Beta 1
Build #AI-191.6707.61.35.5677133, built on June 20, 2019
JRE: 1.8.0_202-release-1483-b39-5396753 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.0.0-25-generic
(specifically the one from the Compose repo)
Version of Gradle Plugin: 3.5.0-beta05
Version of Gradle: whatever frameworks/support/ui is using -- your setup is too damn complicated...
Version of Kotlin: 1.3.41
OS: Ubuntu 19.04
Steps to Reproduce:
Step #1: Define a @Model as a top-level class:
@Model
data class AgreementViewState(var terms: Boolean, var privacy: Boolean) {
val canProceed = terms && privacy
}
Step #2: Attempt to use that @Model in a @Composable:
@Composable
private fun Agreement() {
Padding(8.dp) {
val viewState = +model { AgreementViewState(true, false) }
Column(mainAxisAlignment = MainAxisAlignment.Start, crossAxisAlignment = CrossAxisAlignment.Start) {
Row(mainAxisAlignment = MainAxisAlignment.Start) {
Checkbox(
checked = viewState.terms,
onCheckedChange = { viewState.terms = it }
)
Text(text = "I agree to the terms and conditions")
}
Row(mainAxisAlignment = MainAxisAlignment.Start) {
Checkbox(
checked = viewState.privacy,
onCheckedChange = { viewState.privacy = it }
)
Text(text = "I agree to the privacy policy")
}
Text(text = if (viewState.canProceed) "You may proceed" else "Please indicate your agreement")
}
}
}
Expected Results: No crashes
Actual Results: A crash from generated code when the @Composable is called:
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter r
at androidx.compose.frames.FramesKt._readable(Unknown Source:2)
at androidx.ui.foundation.demos.AgreementViewState.getTerms(Unknown Source:5)
at androidx.ui.foundation.demos.AgreementViewState.<init>(MainActivity.kt:230)
Note that this works:
@Model
data class AgreementViewState(var terms: Boolean, var privacy: Boolean) {
fun canProceed() = terms && privacy
}
...and this works:
@Model
data class AgreementViewState(var terms: Boolean, var privacy: Boolean) {
// fun canProceed() = terms && privacy
}
val AgreementViewState.canProceed
get() = terms && privacy
But, IMHO, the original form ought to work as well, as it seems to be the most natural form of a derived property in Kotlin.
Thanks for considering this!