ionic-team / ionic-team/capacitor-geolocation

[Bug]: rare crash

Open
#88 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
12
Forks
19
PR merge metrics
No merged PRs in 30d

Description

### Current Behavior

Crashlytics showed this crash happened a couple times:

Fatal Exception: ph.e0: lateinit property resolveLocationSettingsResultFlow has not been initialized
at io.ionic.libs.iongeolocationlib.controller.IONGLOCController.onResolvableExceptionResult(IONGLOCController.kt:118)
at com.capacitorjs.plugins.geolocation.GeolocationPlugin$load$activityLauncher$1$1.invokeSuspend(GeolocationPlugin.kt:53)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loopOnce(Looper.java:273)
at android.os.Looper.loop(Looper.java:363)
at android.app.ActivityThread.main(ActivityThread.java:10060)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

### Expected Behavior

no crash

### Reproduction

sorry don't have one, but seems easy enough to catch the error

### Screenshots / Media

_No response_

### Environment Details

```Shell
[repositories/fareclock-tc-next] $ npx cap doctor
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 8.4.1
@capacitor/core: 8.4.1
@capacitor/android: 8.4.1
@capacitor/ios: 8.4.1

Installed Dependencies:

@capacitor/cli: 8.4.0
@capacitor/android: 8.4.0
@capacitor/core: 8.4.0
@capacitor/ios: 8.4.0

[success] iOS looking great! 👌
[success] Android looking great! 👌
```

### Versions Affected

latest

### Platforms Affected

- [ ] iOS
- [x] Android
- [ ] Web

### Notes / Comments

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with IONGLOCController.kt at line 118, then trace the activity-launcher callback in GeolocationPlugin.kt at line 53. Run the Android geolocation flow and inspect the ordering around resolveLocationSettingsResultFlow initialization and the resolvable-exception callback. Done means the reported callback no longer crashes when the flow has not been initialized.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.