-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KitKat version of the app crashes when clicking on the 'Help' menu, and when reopening after app close #3939
Comments
Also: crashes when reopening a profile after crash. Edit: after opening a profile always (except the first open). |
Actually, I'm not sure what's going on here. I can't seem to get the app to open anymore, so maybe something became unstable in the system itself. |
A full reinstall fixed it, but even an emulator restart didn't. I have no clue what was happening there; will need to dig into it more. |
Interestingly, this is tied to Delegates trying to access something not fully in the dex files:
Per https://youtrack.jetbrains.com/issue/KT-17034 it seems Delegates uses KProperty internally, which might be problematic in terms of both dex code needed & reflection (though the latter would be more of a Proguard issue, and we haven't seen problems on alpha builds). Will try to replace the Delegates bit to see if that fixes the crash. Edit: I checked all three dex files and it does seem like WhenMappings isn't being fully included in the Dex. This might actually be a bug with Bazel in how it computes the Dex files; there might be an incompatibility when trying to determine which classes to include that somehow breaks with the Delegates mechanism. Not entirely sure yet. Edit 2: Aha. I'm still not sure why the alpha build works on my Nexus 5X device (which isn't KitKat) but doesn't on KitKat despite containing the same Dex files. Nevertheless, when comparing oppia_dev_kitkat.aab with oppia_dev.aab, it becomes clear that the of LazyKt$WhenMappings is completely missing from the dex list for the KitKat build. This might be because I'm fragmenting up LazyKt in the main class dex list for KitKat (or at least, that's my best guess) which might cause some weirdness with how the dexer is deciding which classes/members to include. |
Adding kotlin/LazyKt$WhenMappings.class to kitkat_main_dex_class_list.txt fixes the crash above, but leads to a new one:
I wonder if this is a reflection thing... Edit: Okay, something weird is going on here. LazyThreadSafetyMode has a placeholder in classes.dex, but the full definition in classes2.dex. I don't understand why the dexer is adding placeholders & I suspect it's the reason for the NoClassDefError. |
https://issuetracker.google.com/issues/131100011 is another possibility, but it's hard for me to know if this is happening with the Kotlin functions. I'm actually quite uncomfortable with this dexing inconsistency, but I think if we can at least get the app working then it should be a good step in the right direction. Replacing Delegates with a standard var seems to avoid the crash (and per https://youtrack.jetbrains.com/issue/KT-15284 we unfortunately can't use lateinit on primitive types). I also confirmed that this help menu crash existed with #3910, I just missed it during development. However, now I'm getting a consistent crash after reopening the app regardless of the above fix, and this time without a stack trace. Need to dig deeper to figure out what's going on. This also happens with #3910. |
Interestingly, the crash from reopening seems to only occur if the app previous crashed. My current repro steps:
Waiting a bit of time with the app closed & then reopening it seems to avoid the crash. |
Ah, there is a stack trace but it's not sent to error logs. This is a native crash happening:
|
Looks like a different repro for #3887 which is a known issue. The sometimes-crash-on-restart is definitely not good, but it seems to generally go away after a bit. |
The crash doesn't seem to repro when using production assets, so I strongly suspect this second crash is exactly #3887. |
* Fix KitKat crash when opening Help menu. * Fix SVG rendering on SDKs 19-23 (incl). * Add regex check to prohibit Delegates. * Lint fixes. * Add exemption for regex script test. * Update file_content_validation_checks.textproto Grammar fix in error. * Update RegexPatternValidationCheckTest.kt Copy grammar fix to test copy of error.
* Fix KitKat crash when opening Help menu. * Fix SVG rendering on SDKs 19-23 (incl). * Add regex check to prohibit Delegates. * Lint fixes. * Add exemption for regex script test. * Update file_content_validation_checks.textproto Grammar fix in error. * Update RegexPatternValidationCheckTest.kt Copy grammar fix to test copy of error.
#3975) * Fix #3946: Fix solution automatically revealing after first hint reveal (#3955) * Fix solution auto showing after hint reveal. See #3946 & PR for specifics. * Add translations for new hint/solution. * Lint fixes. * Add TODO. * Fix Gradle-variant tests. * Fix #3937: Ensure ViewEventLogsViewModel builds for alpha builds (#3957) * Ensure ViewEventLogsViewModel builds for alpha. * BUILD file lint fix. * Fix #3939 & #3938: Fix KitKat crash & SVG rendering issues (#3963) * Fix KitKat crash when opening Help menu. * Fix SVG rendering on SDKs 19-23 (incl). * Add regex check to prohibit Delegates. * Lint fixes. * Add exemption for regex script test. * Update file_content_validation_checks.textproto Grammar fix in error. * Update RegexPatternValidationCheckTest.kt Copy grammar fix to test copy of error. * Update version.bzl (#3964) Bump version codes for another RC of release-0.6. * Embed proguard.map in optimized AAB builds. (#3973)
For searching context, this issue was found in 0.6-alpha (MR3). |
See title.
Note that for the reopening, the app needs to be swiped away in recents to trigger the issue.
The text was updated successfully, but these errors were encountered: