View instance crash


#1

when it happens:
-im on a view and open the drawer, close it and go to other page, on coming back it crashes building the view. The view has a drawer and a google maps sdk mapView and some other UI components.
the error displayed:

  • android.view.AbsSavedState$1 cannot be cast to org.nativescript.widgets.HorizontalScrollView$SavedState
    what i tried:
    -checking for components with same id on the both pages.
    -updated all plugins and checked dependencies.

#2

I have similar issue and it’s an issue with listview and google maps for me but I’d imagine other modules might have similar issues:

Removing listView from the component navigating to worked for me.

Here’s a discussion on github although the solution mentioned according to one user:


#3

This reminds me furiously of a bug I experienced last summer with list views and google maps that you mentionned. Yet I haven’t seen this for a long time, and I thought it was fixed for a long time now.

It may not be useful to mention, but are you sure you’re up to date with nativescript ?


#4

@Eric,

Yes, I am experiencing that error right now. I am on the latest version of NS2. I see the error when I use the android back button and the page I am going back to is the mapview with a listview.

Any ideas on how to resolve?

java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to org.nativescript.widgets.HorizontalScrollView$SavedState
05-07 12:16:06.060  4878  4878 V JS      :      at org.nativescript.widgets.VerticalScrollView.onRestoreInstanceState(VerticalScrollView.java:166)
05-07 12:16:06.060  4878  4878 V JS      :      at android.view.View.dispatchRestoreInstanceState(View.java:15633)
05-07 12:16:06.060  4878  4878 V JS      :      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3268)
05-07 12:16:06.060  4878  4878 V JS      :      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3274)
05-07 12:16:06.060  4878  4878 V JS      :      at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3274)
05-07 12:16:06.060  4878  4878 V JS      :      at android.view.View.restoreHierarchyState(View.java:15611)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.Fragment.restoreViewState(Fragment.java:645)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1016)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.BackStackRecord.popFromBackStack(BackStackRecord.java:1747)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1691)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl$3.run(FragmentManager.java:586)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.FragmentManagerImpl$1.run(FragmentManager.java:483)
05-07 12:16:06.060  4878  4878 V JS      :      at android.os.Handler.handleCallback(Handler.java:751)
05-07 12:16:06.060  4878  4878 V JS      :      at android.os.Handler.dispatchMessage(Handler.java:95)
05-07 12:16:06.060  4878  4878 V JS      :      at android.os.Looper.loop(Looper.java:154)
05-07 12:16:06.060  4878  4878 V JS      :      at android.app.ActivityThread.main(ActivityThread.java:6077)
05-07 12:16:06.060  4878  4878 V JS      :      at java.lang.reflect.Method.invoke(Native Method)
05-07 12:16:06.060  4878  4878 V JS      :      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
05-07 12:16:06.060  4878  4878 V JS      :      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

#5

Hello randy, i don’t work anymore using NS, still, i know this problem was caused when i first posted it due to having scrollable components inside scrollable components, like a google map inside a scrollview.
Hope that can help you.