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

TurboPathConfiguration.Location with unreachable remoteFileUrl crashes #271

Closed
HE-LU opened this issue Apr 18, 2023 · 2 comments
Closed

Comments

@HE-LU
Copy link

HE-LU commented Apr 18, 2023

Hey,

we are extending TurboSessionNavHostFragment in our app, and we are overriding pathConfigurationLocation as follows.

override val pathConfigurationLocation: TurboPathConfiguration.Location = TurboPathConfiguration.Location(
    assetFilePath = "json/configuration.json",
    remoteFileUrl = ApiUtils.apiRouteSettings,
)

The issue occurs when the API host is for any reason unreachable, or the config is not found at the time, the app crashes when inflating MainActivity layout with the FragmentContainerView.

<androidx.fragment.app.FragmentContainerView
    android:id="@+id/mainNavHost"
    android:name="com.example.ui.SessionNavHostFragment" />

Important things from a LogCat:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activities.MainActivity}: android.view.InflateException: Binary XML file line #47 in com.example:layout/activity_main: Binary XML file line #47 in com.example:layout/activity_main: Error inflating class androidx.fragment.app.FragmentContainerView

Caused by: android.view.InflateException: Binary XML file line #47 in com.example:layout/activity_main: Binary XML file line #47 in com.example:layout/activity_main: Error inflating class androidx.fragment.app.FragmentContainerView
Caused by: android.view.InflateException: Binary XML file line #47 in com.example:layout/activity_main: Error inflating class androidx.fragment.app.FragmentContainerView
Caused by: java.lang.IllegalArgumentException: A start Fragment destination was not found for uri: turbo://fragment/web
@diegocharles
Copy link

I spent a full week until I realise this.
Thank you for opening this Issue.

@jayohms
Copy link
Collaborator

jayohms commented Feb 23, 2024

Thanks for the report! Addressed in #305

@jayohms jayohms closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants