Comments (4)
Hi π
This is definitively not an issue general to parcelable nav arguments given that I have plenty of working examples with them.
Can you share more about how the class looks like and how you are navigating?
As a side note, the function βparseValueβ is not called by us, official library is orchestrating that.
from compose-destinations.
Also, add the crash stacktrace if possible π
from compose-destinations.
Hey, thanks for the fast reply!
Alright, thanks for the info. That's good to know. Ye I tried it with multiple different classes but I can surely share an example.
@Parcelize
actual class Filter actual constructor(
val selectedFilterTagIds: List<Int>
) : Parcelable
That's my target composable
@Destination<RecipeCategoryGraph>(
start = true,
visibility = CodeGenVisibility.INTERNAL
)
@Composable
internal fun RecipeCategoryScreen(
filter: Filter,
navigator: DestinationsNavigator,
viewModel: RecipeCategoryViewModel = viewModel { RecipeCategoryViewModel(filter) }
)
That's my navigate call
RecipeCategoryNavGraph(
navArgs = RecipeCategoryScreenDestinationNavArgs(
Filter(result.value.selectedTagIds)
)
)
from compose-destinations.
Also, add the crash stacktrace if possible π
Ye, sure:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.Collections$SingletonList.get(Collections.java:5042)
at com.ramcosta.composedestinations.navargs.parcelable.DefaultParcelableNavTypeSerializer.fromRouteString(DefaultParcelableNavTypeSerializer.kt:28)
at com.ramcosta.composedestinations.navargs.parcelable.DefaultParcelableNavTypeSerializer.fromRouteString(DefaultParcelableNavTypeSerializer.kt:19)
at com.ramcosta.composedestinations.generated.recipecategory.navtype.RecipeSearchTypeNavType.parseValue(RecipeSearchTypeNavType.kt:33)
at com.ramcosta.composedestinations.generated.recipecategory.navtype.RecipeSearchTypeNavType.parseValue(RecipeSearchTypeNavType.kt:16)
at androidx.navigation.NavType.parseAndPut(NavType.kt:95)
at androidx.navigation.NavDeepLink.parseArgument(NavDeepLink.kt:361)
at androidx.navigation.NavDeepLink.getMatchingPathArguments(NavDeepLink.kt:261)
at androidx.navigation.NavDeepLink.getMatchingArguments(NavDeepLink.kt:194)
at androidx.navigation.NavDestination.matchDeepLink(NavDestination.kt:403)
at androidx.navigation.NavDestination.matchDeepLink(NavDestination.kt:381)
at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:88)
at androidx.navigation.NavGraphNavigator.navigate(NavGraphNavigator.kt:59)
at androidx.navigation.NavController.navigateInternal(NavController.kt:271)
at androidx.navigation.NavController.navigate(NavController.kt:2040)
at androidx.navigation.NavController.navigate(NavController.kt:1973)
at androidx.navigation.NavController.navigate(NavController.kt:2400)
at com.ramcosta.composedestinations.navigation.DestinationsNavController.navigate(DestinationsNavController.kt:33)
at com.ramcosta.composedestinations.navigation.DestinationsNavigator$DefaultImpls.navigate$default(DestinationsNavigator.kt:52)
at com.example.RecipesScreenKt$RecipesScreen$1$1.invoke(RecipesScreen.kt:53)
at com.example.RecipesScreenKt$RecipesScreen$1$1.invoke(RecipesScreen.kt:49)
at com.ramcosta.composedestinations.result.ResultRecipientImpl.handleResultIfPresent(ResultRecipientImpl.kt:66)
at com.ramcosta.composedestinations.result.ResultRecipientImpl.access$handleResultIfPresent(ResultRecipientImpl.kt:17)
at com.ramcosta.composedestinations.result.ResultRecipientImpl$onNavResult$1$observer$1.onStateChanged(ResultRecipientImpl.kt:36)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.jvm.kt:198)
at com.ramcosta.composedestinations.result.ResultRecipientImpl.onNavResult$lambda$2(ResultRecipientImpl.kt:48)
at com.ramcosta.composedestinations.result.ResultRecipientImpl.$r8$lambda$QiPsutwrk8k00_u_HUuef2cXYxg(Unknown Source:0)
at com.ramcosta.composedestinations.result.ResultRecipientImpl$$ExternalSyntheticLambda0.invoke(Unknown Source:6)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83)
at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1364)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:992)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1013)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:678)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:578)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1397)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1408)
at android.view.Choreographer.doCallbacks(Choreographer.java:1008)
at android.view.Choreographer.doFrame(Choreographer.java:934)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1382)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
from compose-destinations.
Related Issues (20)
- Removing from composition and re-adding when navigating HOT 3
- java.lang.IllegalStateException: Duplicate route found X_destination'. Routes must be unique!. In Muli-module project. HOT 2
- Missing classes detected while running R8 on AGP 8.4.0 HOT 2
- Video tutorials for using the library. HOT 1
- [KSP][2.1.0] _ModuleRegistry missing visibility modifiers HOT 4
- [DEEPLINK][2.1.0] Request to bring back withDeepLink() HOT 9
- Can compose-destinations used in compose for desktop project ? HOT 1
- Accompanist Navigation Material functionality now available in androidx.compose.material.navigation.* HOT 2
- "Reproducible build" possible with Compose Destinations? HOT 5
- popUpTo matches navArgs exactly HOT 4
- Multiple Backstacks HOT 1
- [Improvement] moduleName could be automatically raname to "main" HOT 1
- Multiple NavGraphs with shared routes on V2 HOT 1
- Sharing a view model between destinations but with a view model factory HOT 3
- Multiple DestinationsNavHost
- upgraded from 2.0.0-beta02 to 2.0.0-beta09 HOT 4
- [KSP] Destinations generation issue HOT 1
- Standalone Sealed Classes as NavArgs in Android HOT 2
- Could not find Navigator with name "BottomSheetNavigator". You must call NavController.addNavigator() for each navigation type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-destinations.