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

Can't open category in showcase browser #310

Closed
RadoslawGorczyca opened this issue Mar 28, 2023 · 13 comments
Closed

Can't open category in showcase browser #310

RadoslawGorczyca opened this issue Mar 28, 2023 · 13 comments

Comments

@RadoslawGorczyca
Copy link

When I open showkase browser I can see categories correctly, but when I click on one, the screen title changes, but rest of the screen stays the same, still showing the same categories. Then no matter how many times I click on category - nothing changes. When I press physical back button, the app crashes. Error I see:

E/MessageQueue-JNI: java.lang.IllegalArgumentException: Navigation destination that matches request NavDeepLinkRequest{ uri=android-app://androidx.navigation/SHOWKASE_CATEGORIES } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0x7bb10103) route=COMPONENT_GROUPS}

I would really appreciate some help.

@polivmi1
Copy link

Same problem 1.0.0-beta18, but no logs nor crash.
Screenshot 2023-03-28 at 22 23 50

@vinaygaba
Copy link
Collaborator

@oas004 Do you think it could be related to any of your recent changes?

@vinaygaba
Copy link
Collaborator

This is also a suspicious PR that could impact this behavior - #222
We do have UI Tests to cover some of the basic use cases.

@oas004
Copy link
Contributor

oas004 commented Mar 28, 2023

I tried it out in the sample app in the project, is that screenshot above from the project you sent me @polivmi1 ? Or from another internal project? :)

I can't quite imagine what can cause this, but I will debug it further

@oas004
Copy link
Contributor

oas004 commented Mar 28, 2023

I tried also removing all the typography as that is in the screenshot, but I can't reproduce it :(

@polivmi1
Copy link

@oas004 I have quickly tried adding more stuff to the sample (+fixing the context to run it) and with colors or more previews and combinations I wasn't able to reproduce. I guess there will be some preview composable that has problems. Is there any way to allow or see more logs from Showkase? I will try tomorrow to see if I can reduce my project to the way when it starts to work...

@polivmi1
Copy link

polivmi1 commented Mar 28, 2023

Ending up only with 1 Preview it still fails, so this must be some set-up stuff - maybe gradle build variants generation...I can look into it more tomorrow

@Preview
@Composable
fun TextPreview() {
    Text("text")
}

Screenshot 2023-03-28 at 23 15 58

@polivmi1
Copy link

I was able to reproduce same crash as mentioned by the author. Still can't get a smaller reproducible sample. I wonder if this is correct "uri=android-app://androidx.navigation/SHOWKASE_CATEGORIES" and shouldn't it have the app package name there.

FATAL EXCEPTION: main
         Process: , PID: 12034
         java.lang.IllegalArgumentException: Navigation destination that matches request NavDeepLinkRequest{ uri=android-app://androidx.navigation/SHOWKASE_CATEGORIES } cannot be found in the navigation graph NavGraph(0x0) startDestination={Destination(0xb29e665d) route=COLOR_GROUPS}
                                                                                                    	at androidx.navigation.NavController.navigate(NavController.kt:1775)
                                                                                                    	at androidx.navigation.NavController.navigate(NavController.kt:2173)
                                                                                                    	at androidx.navigation.NavController.navigate$default(NavController.kt:2168)
                                                                                                    	at com.airbnb.android.showkase.ui.ShowkaseBrowserAppKt.navigate(ShowkaseBrowserApp.kt:558)
                                                                                                    	at com.airbnb.android.showkase.ui.ShowkaseCategoriesScreenKt.goBackToCategoriesScreen(ShowkaseCategoriesScreen.kt:90)
                                                                                                    	at com.airbnb.android.showkase.ui.ShowkaseGroupsScreenKt$ShowkaseGroupsScreen$2.invoke(ShowkaseGroupsScreen.kt:52)
                                                                                                    	at com.airbnb.android.showkase.ui.ShowkaseGroupsScreenKt$ShowkaseGroupsScreen$2.invoke(ShowkaseGroupsScreen.kt:51)
                                                                                                    	at com.airbnb.android.showkase.ui.BackButtonHandlerKt$BackButtonHandler$1$1$1.invoke(BackButtonHandler.kt:69)
                                                                                                    	at com.airbnb.android.showkase.ui.BackButtonHandlerKt$BackButtonHandler$1$1$1.invoke(BackButtonHandler.kt:68)
                                                                                                    	at com.airbnb.android.showkase.ui.ComposableBackHandler.handleOnBackPressed(BackButtonHandler.kt:25)
                                                                                                    	at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:213)
                                                                                                    	at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.java:693)
                                                                                                    	at android.app.Activity.onKeyUp(Activity.java:3882)
                                                                                                    	at android.view.KeyEvent.dispatch(KeyEvent.java:2925)
                                                                                                    	at android.app.Activity.dispatchKeyEvent(Activity.java:4228)
                                                                                                    	at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:126)
                                                                                                    	at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:86)
                                                                                                    	at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:144)
                                                                                                    	at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:604)
                                                                                                    	at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:60)
                                                                                                    	at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3413)
                                                                                                    	at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:402)
                                                                                                    	at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:6584)
                                                                                                    	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6450)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5910)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6098)
                                                                                                    	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6155)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
                                                                                                    	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5941)
                                                                                                    	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5914)
                                                                                                    	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5967)
                                                                                                    	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5933)
                                                                                                    	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6131)
                                                                                                    	at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:6311)
                                                                                                    	at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3649)
                                                                                                    	at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:3169)
                                                                                                    	at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:3160)

@polivmi1
Copy link

Reverting the showkase version shows the same problem, so it isn't a 1.0.0-beta18 problem, but some project configuration that got updated and broke the showkase lib navigation. (previously it worked with 1.0.0-beta17)

@polivmi1
Copy link

@oas004 this is related to https://github.com/raamcosta/compose-destinations/releases where most likely some dependencies got overwritten due to mismatching compose or other setup versions. That then caused this strange behavior. 1.8.36-beta of that library doesn't work, but 1.8.38-beta works normally. (same will be most likely with the native compose destination or accompanist dependency)
So from my side, this can be marked as resolved.

@oas004
Copy link
Contributor

oas004 commented Mar 29, 2023

hmm, okay. I don't know if I quite got that. Is it because you are using the compose-destination library and we are transitively downgrading it? 🤔
@RadoslawGorczyca Could you verify that updating that library solves the issue for you as well?

@RadoslawGorczyca
Copy link
Author

I managed to find the cause for this problem. Recently in my project there was libraries update, which caused showkase to stop working correctly. I checked all of them and it seems that updating accompanist from 0.29.1-alpha to 0.29.2-rc and navigation-compose from 2.6.0-alpha05 to 2.6.0-alpha07 are what caused the issue. Reverting those updates fixed it.

@AhmedAshour
Copy link

AhmedAshour commented Sep 21, 2023

I encountered the same issue and none of the suggested solutions worked for me. However, I found a solution that resolved the problem, and I'd like to share it in case it helps others facing a similar issue.

I'm using Showkase version 1.0.2.

The issue was related to the navigation-compose library (I also have Accompanist, but it wasn't causing the problem). I initially had version 2.6.0 of navigation-compose, but after updating it to 2.7.0-alpha01 or later versions, the problem was resolved, and everything works as expected now.

@vinaygaba
I suggest to add a section at the end of Readme saying troubleshooting or something and mention the fixes people find for such problem as it can be time consuming for others if they face it in the future. I can make a PR if you find it useful.

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

5 participants