[Crash] ActivityNotFound
android.content.ActivityNotFoundException:
at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2018)
at android.app.Instrumentation.execStartActivity (Instrumentation.java:1673)
at android.app.Activity.startActivityForResult (Activity.java:4688)
at androidx.fragment.app.FragmentActivity.startActivityForResult (FragmentActivity.java:6)
at android.app.Activity.startActivityForResult (Activity.java:4646)
at androidx.fragment.app.FragmentActivity.startActivityForResult (FragmentActivity.java:3)
at android.app.Activity.startActivity (Activity.java:5007)
at androidx.core.app.ActivityCompat.startActivity (ActivityCompat.java:2)
at mozilla.components.feature.customtabs.CustomTabWindowFeature$start$1$invokeSuspend$$inlined$collect$1.emit (Collect.kt:14)
at mozilla.components.support.ktx.kotlinx.coroutines.flow.FlowKt$ifChanged$$inlined$filter$1$2.emit (Collect.kt:7)
at mozilla.components.feature.customtabs.CustomTabWindowFeature$start$1$invokeSuspend$$inlined$mapNotNull$1$2.emit (Collect.kt:6)
at kotlinx.coroutines.EventLoopKt.emitAll (EventLoop.kt:15)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAll$1.invokeSuspend (Unknown Source:10)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:2)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:15)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:214)
at android.app.ActivityThread.main (ActivityThread.java:6986)
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:1445)
https://play.google.com/apps/publish/?account=7083182635971239206#AndroidMetricsErrorsPlace:p=org.mozilla.fenix&appid=4975374341268119750&appVersion=PRODUCTION&lastReportedRange=LAST_14_DAYS&clusterName=apps/org.mozilla.fenix/clusters/11c21c0f&detailsAppVersion=PRODUCTION&detailsSpan=14
┆Issue is synchronized with this Jira Task
Steps to reproduce
- Make Fenix default browser (
Settings->Set as default browser) - From the gmail app send a mail with this link: https://www.fonvirtual.com/en/international-phone-number/
- Go to gmail app and access that link. Should be opened in a Fenix custom tab.
- From the top of the screen tap on
Click to Speak, near the phone number.
Expected behaviour
- The app should handle the
telscheme or to show an appropriate error.
Actual behaviour
- The app crashes
Device information
- Samsung Galaxy Note 10 (Android 10)
Crash informations
StackTrace
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[mozilla.components.pwa.category.SHORTCUT] dat= pkg=org.mozilla.fenix (has extras) }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2071)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1717)
at android.app.Activity.startActivityForResult(Activity.java:5276)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:6)
at android.app.Activity.startActivityForResult(Activity.java:5234)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:3)
at android.app.Activity.startActivity(Activity.java:5605)
at androidx.core.app.ActivityCompat.startActivity(ActivityCompat.java:2)
at mozilla.components.feature.customtabs.CustomTabWindowFeature$start$1$invokeSuspend$$inlined$collect$1.emit(Collect.kt:14)
at mozilla.components.support.ktx.kotlinx.coroutines.flow.FlowKt$ifChanged$$inlined$filter$1$2.emit(Collect.kt:7)
at mozilla.components.feature.customtabs.CustomTabWindowFeature$start$1$invokeSuspend$$inlined$mapNotNull$1$2.emit(Collect.kt:6)
at kotlinx.coroutines.EventLoopKt.emitAll(EventLoop.kt:15)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAll$1.invokeSuspend(Unknown Source:10)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:15)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7770)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)
I opened an issue in AC to fix the crash.
@ValentinTimisica tested on Samsung Galaxy Note10 (Android 10) this issue and "click to speak" option is not working/not responsive in custom tab - Nightly, but works if the link is opened in the browser.
The browser is not crashing opening the link, like is happening on Beta.
This should be the fix for this bug?
Hello @sflorean, I investigated the problem and it seems like it's a Fenix Snackbar related issue. The snackbar shows only when the toolbar is set to top. I created #9812 for the Snackbar bug.
Related to the current crash I created below the testing notes:
Testing notes
- Make Fenix default browser (
Settings->Set as default browser) - Set toolbar to top (
Settings->Customize). This is done to bypass the Snackbar bug described above. - From the gmail app send a mail with this link: https://www.fonvirtual.com/en/international-phone-number/
- Go to gmail app and access that link. Should be opened in a Fenix custom tab.
- From the top of the screen tap on
Click to Speak, near the phone number. - Now a snackbar with the message
Unable to connect. Unrecognizable URL schemewill show.
Check video with the fix below
Verified as fixed on Fenix 4.3.0 - beta.1 with Samsung Galaxy Note 10 (Android 10). @ValentinTimisica thank you for the extra step.