Skip to content
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

UninitializedPropertyAccessException #165

Closed
boomer30 opened this issue Jun 13, 2023 · 4 comments
Closed

UninitializedPropertyAccessException #165

boomer30 opened this issue Jun 13, 2023 · 4 comments

Comments

@boomer30
Copy link

Getting the following error when I start the app

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.mediapipe.examples.poselandmarker, PID: 23887
kotlin.UninitializedPropertyAccessException: lateinit property poseLandmarkerHelper has not been initialized
at com.google.mediapipe.examples.poselandmarker.fragment.CameraFragment$initBottomSheetControls$8.onItemSelected(CameraFragment.kt:254)
at android.widget.AdapterView.fireOnSelected(AdapterView.java:957)
at android.widget.AdapterView.dispatchOnItemSelected(AdapterView.java:946)
at android.widget.AdapterView.-$$Nest$mdispatchOnItemSelected(Unknown Source:0)
at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:910)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@boomer30
Copy link
Author

boomer30 commented Jun 13, 2023

I upgraded to Flamingo and upgraded Gradle to 8.0. I no longer get the error above, but the app is still shutting down immediately after opening. I have tried running it on a physical Pixel 7 Pro and a Pixel 5 emulator. The behavior is the same for both.

@PaulTR
Copy link
Collaborator

PaulTR commented Jun 16, 2023

Is there an error for it after all of the updates and whatnot? I just tried it on a physical pixel 7 and cannot reproduce the problem. If it's a lateinit issue, we might just need to wrap the code with the helper with

if(this::poseLandmarkerHelper.isInitialized) {
}

@boomer30
Copy link
Author

It does not produce an error. It just shuts down immediately

@PaulTR
Copy link
Collaborator

PaulTR commented Jun 27, 2023

I'm going to try and wrap all the usages of poseLandmarkerHelper in the isInitialized flag check, so we'll see how that goes (I never was able to replicate the issue, unfortunately, but that's the joys of race conditions :)) Closing this out, but let me know if you still have issues after that fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants