Skip to content

[BUG] crash when opening a URL #502

@Julius-Babies

Description

@Julius-Babies

Prolog

We use Chrome Custom Tabs to launch a simplified Version of the users browser when opening a web page (see https://github.com/VPlanPlus-Project/app/blob/f3f6b72c799ea2bebad64d8c87cdd29bc215fc76/composeApp/src/commonMain/kotlin/plus/vplan/app/utils/browserUtils.kt)

Issue

We received a bug report via Email stating the app would crash when trying to open the browser.

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://github.com/... xflg=0x4 (has extras) }
	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2509)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:2035)
	at android.app.Activity.startActivityForResult(Activity.java:6322)
	at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.kt:707)
	at android.app.Activity.startActivity(Activity.java:6778)
	at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:195)
	at androidx.browser.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:826)
	at plus.vplan.app.utils.BrowserUtils_androidKt.openUrl(browserUtils.android.kt:12)
	at plus.vplan.app.feature.settings.page.info.ui.InfoScreenKt.InfoContent$lambda$4$0$8$0(InfoScreen.kt:232)
	at plus.vplan.app.feature.settings.page.info.ui.InfoScreenKt.$r8$lambda$fPIP1LMp6pBYtm3eJw1r-UQ_zUA(InfoScreen.kt:0)
	at plus.vplan.app.feature.settings.page.info.ui.InfoScreenKt$$ExternalSyntheticLambda6.invoke(D8$$SyntheticClass:0)
	at plus.vplan.app.feature.settings.ui.components.SettingsRecordKt.BaseSettingsRecord$lambda$0$0$0(SettingsRecord.kt:102)
	at plus.vplan.app.feature.settings.ui.components.SettingsRecordKt.$r8$lambda$4f-Vi5Omcl24RifhhBXMz1PHT04(SettingsRecord.kt:0)
	at plus.vplan.app.feature.settings.ui.components.SettingsRecordKt$$ExternalSyntheticLambda2.invoke(D8$$SyntheticClass:0)
	at androidx.compose.foundation.ClickableNode.onPointerEvent-H0pRuoY(Clickable.kt:935)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:446)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:432)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:432)
	at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:432)
	at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:285)
	at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:181)
	at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:118)
	at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:2685)
	at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:2629)
	at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:2467)
...

Criteria

  • Catch this exception to prevent a crash
  • Investigate if this can happen on devices without any Browser(engine) installed
  • Investigate if this can happen on devices lacking Google Play Services

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't workingstate:openThis item is available to be picked uptype:good-first-issueRecommended for new contributors

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions