Giter VIP home page Giter VIP logo

voyager's People

Contributors

adrielcafe avatar alaksion avatar arslan-charyyev-pc avatar cortinico avatar devsrsouza avatar kashif-e avatar programadorthi avatar syer10 avatar terrakok avatar williankl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

voyager's Issues

CreationExtras must have a value by SAVED_STATE_REGISTRY_OWNER_KEY` error

Regarding: adrielcafe#86

Happens at val viewModel = getViewModel<...> seems like something to do with Transitions:

java.lang.IllegalArgumentException: CreationExtras must have a value by `SAVED_STATE_REGISTRY_OWNER_KEY`
                                                         	at androidx.lifecycle.SavedStateHandleSupport.createSavedStateHandle(SavedStateHandleSupport.kt:91)
                                                         	at androidx.lifecycle.AbstractSavedStateViewModelFactory.create(AbstractSavedStateViewModelFactory.java:89)
                                                         	at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:116)
                                                         	at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
                                                         	at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
                                                         	at ***.IntroductionScreen.Content(IntroductionScreen.kt:315)
                                                         	at cafe.adriel.voyager.transitions.ComposableSingletons$SlideTransitionKt$lambda-1$1.invoke(SlideTransition.kt:30)
Navigator(ScreenRegistry.get(initialScreen)) { navigator ->
            SlideTransition(navigator)
...
}

RC5 introduce a state bug

So this is quite strange and I have not yet debug it reporting first in case there's something obvious.

Now when I switch tabs with my custom tab navigator that keep the tabs states the state is lost on the first switch but not on the future ones.

Like I'm on tab A and scroll down, go to tab B, return to tab A, the screen is reset at top. Do the same again and all future cases do properly keep state, like something is not initialized on first instance creation.

Edit: So confirmed it was added in RC5, will try to figure out, but I hate AS not supporting multiplatform composite builds :(

RC05, RC06, RC07 crashes when re-initializing state

I will tell you how to reproduce. Here is sample code: crash-sample.zip

  1. Make sure you have old Logcat enabled, so that we may simulate system killing of the app. This app kill must be done with the old Logcat button, since all other 'stop' buttons mean something different, and Google engineers have not ported this functionality to any other affordance. See 249950445 for more information. Enable old Logcat through: Settings > Experimental > unselect 'Enable new Logcat'
  2. Use ca.gosyer:voyager-navigator:1.0.0-rc05+
  3. Open App with nested Navigator, as provided in the sample code
  4. Navigate to sub-post
  5. Background the app
  6. Use the 'Terminate Application' button in the left-hand pane of the old Logcat screen, then foreground the app again. This simulated the situation in the wild where the app is backgrounded ~30m, and then terminated by the system, then reopened
  7. *crash*
2022-12-24 21:49:27.949 9817-9817/com.example.voyagersample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.voyagersample, PID: 9817
    java.lang.IllegalArgumentException: Key Screen#1:currentScreen:lifecycle was used multiple times 
        at androidx.compose.runtime.saveable.SaveableStateHolderImpl$SaveableStateProvider$1$1.invoke(SaveableStateHolder.kt:89)
        at androidx.compose.runtime.saveable.SaveableStateHolderImpl$SaveableStateProvider$1$1.invoke(SaveableStateHolder.kt:88)
        at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:81)
        at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1091)
        at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:818)
        at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:839)
        at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:978)
        at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1060)
        at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
        at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
        at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.java:202)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
        at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
        at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1147)
        at android.view.View.dispatchAttachedToWindow(View.java:21290)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3491)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3498)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3498)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3498)
        at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3498)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2820)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2328)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9087)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
        at android.view.Choreographer.doCallbacks(Choreographer.java:899)
        at android.view.Choreographer.doFrame(Choreographer.java:832)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

I can't make a screencast while the emulator is running, so I've made a screencast on my phone. See attachment.

image

Perhaps this has something to do with the screens being re-created with 'unique' screen id's, that are not unique anymore since the AtomicInt counter is reset when the app is killed? I do not understand how this SavedState business works. ๐Ÿคท

Perhaps related to #2? I also don't understand what's going on there...
crash-sample.zip

video5276423471243471433.mp4

edit: oops, I meant the text to appear only when the app was backgrounded, of course :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.