Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Lifecycle owner crash (DEV) #4788

Merged
merged 4 commits into from
Feb 7, 2022
Merged

Conversation

mtwalli
Copy link
Contributor

@mtwalli mtwalli commented Feb 7, 2022

Trying to fix this crash:

java.lang.IllegalStateException: 
  at androidx.fragment.app.Fragment.getViewLifecycleOwner (Fragment.java:2)
  at de.rki.coronawarnapp.util.ui.ViewBindingExtensionsKt$viewBinding$2.invoke (ViewBindingExtensions.kt:3)
  at de.rki.coronawarnapp.util.ui.ViewBindingProperty.getValue (ViewBindingExtensions.kt:9)
  at de.rki.coronawarnapp.qrcode.ui.QrCodeScannerFragment.getBinding (QrCodeScannerFragment.kt:1)
  at de.rki.coronawarnapp.qrcode.ui.QrCodeScannerFragment.startDecode (QrCodeScannerFragment.kt:1)
  at de.rki.coronawarnapp.qrcode.ui.QrCodeScannerFragment$$ExternalSyntheticLambda12.onDismiss (Unknown Source:2)
  at android.app.Dialog$ListenersHandler.handleMessage (Dialog.java:1586)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:214)
  at android.app.ActivityThread.main (ActivityThread.java:7050)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:965)

my assumption, it is a bug in the viewBinding lazy that is trying to access the lifecycle owner while fragment is closing

@mtwalli mtwalli added bug Something isn't working maintainers Tag pull requests created by maintainers labels Feb 7, 2022
@mtwalli mtwalli added this to the 2.18.0 milestone Feb 7, 2022
@mtwalli mtwalli requested a review from a team February 7, 2022 09:13
@sonarcloud
Copy link

sonarcloud bot commented Feb 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@SamuraiKek SamuraiKek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well. No hiccups found.

@SamuraiKek SamuraiKek self-assigned this Feb 7, 2022
@BMItr BMItr self-assigned this Feb 7, 2022
@mtwalli mtwalli merged commit 009abd0 into release/2.18.x Feb 7, 2022
@mtwalli mtwalli deleted the fix/lifecycleOwner-crash branch February 7, 2022 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants