question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tab which contains map view causes app to crash

See original GitHub issue

I get this uncaught exception, randomly on my tab view layout. There are 3 tabs, the first and the last one have a list view in it. The middle one is a flexbox layout.

I’m not able to understand what is causing this.

Update: Found a way to recreate it. This is happening if I minimize my app, reopen it and try to switch tabs.

Update 2: This crash is occuring because of nativescript-google-maps-sdk plugin, I have a map view in my 2nd tab

An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: 
Calling js method instantiateItem failed

Error: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.AbsListView$SavedState
    android.widget.AbsListView.onRestoreInstanceState(AbsListView.java:2721)
    android.view.View.dispatchRestoreInstanceState(View.java:16886)
    android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:3490)
    android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:1195)
    android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3476)
    android.view.View.restoreHierarchyState(View.java:16864)
    com.tns.Runtime.callJSMethodNative(Native Method)
    com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
    com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
    com.tns.Runtime.callJSMethod(Runtime.java:912)
    com.tns.Runtime.callJSMethod(Runtime.java:896)
    com.tns.Runtime.callJSMethod(Runtime.java:888)
    com.tns.gen.android.support.v4.view.PagerAdapter_frnal_ts_helpers_l58_c38_PagerAdapterImpl.instantiateItem(PagerAdapter_frnal_ts_helpers_l58_c38_PagerAdapterImpl.java:24)
    android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1034)
    android.support.v4.view.ViewPager.populate(ViewPager.java:1216)
    android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
    android.support.v4.view.ViewPager$3.run(ViewPager.java:273)
    android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
    android.view.Choreographer.doCallbacks(Choreographer.java:702)
    android.view.Choreographer.doFrame(Choreographer.java:635)
    android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
    android.os.Handler.handleCallback(Handler.java:751)
    android.os.Handler.dispatchMessage(Handler.java:95)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6682)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
File: "file:///data/data/com.somecompany.someapp/files/app/tns_modules/tns-core-modules/ui/tab-view/tab-view.js, line: 47, column: 37

StackTrace: 
	Frame: function:'PagerAdapterImpl.instantiateItem', file:'file:///data/data/com.somecompany.someapp/files/app/tns_modules/tns-core-modules/ui/tab-view/tab-view.js', line: 47, column: 38


	at com.tns.Runtime.callJSMethodNative(Native Method)
	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1043)
	at com.tns.Runtime.callJSMethodImpl(Runtime.java:925)
	at com.tns.Runtime.callJSMethod(Runtime.java:912)
	at com.tns.Runtime.callJSMethod(Runtime.java:896)
	at com.tns.Runtime.callJSMethod(Runtime.java:888)
	at com.tns.gen.android.support.v4.view.PagerAdapter_frnal_ts_helpers_l58_c38_PagerAdapterImpl.instantiateItem(PagerAdapter_frnal_ts_helpers_l58_c38_PagerAdapterImpl.java:24)
	at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:1034)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1216)
	at android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
	at android.support.v4.view.ViewPager$3.run(ViewPager.java:273)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
	at android.view.Choreographer.doCallbacks(Choreographer.java:702)
	at android.view.Choreographer.doFrame(Choreographer.java:635)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6682)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.AbsListView$SavedState
	at android.widget.AbsListView.onRestoreInstanceState(AbsListView.java:2721)
	at android.view.View.dispatchRestoreInstanceState(View.java:16886)
	at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:3490)
	at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:1195)
	at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3476)
	at android.view.View.restoreHierarchyState(View.java:16864)
	... 22 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
lock[bot]commented, Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Maps MapFragment causing the app to crash
The app is working fine when changing from the initial tab with the map (tab 1) to any other, but when trying to...
Read more >
How to fix Maps when it crashes - Android - Google Maps Help
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >
MapKit crash on Catalyst after res… | Apple Developer Forums
Hi,. I am faced with a strange problem with a Catalyst app that uses MapKit. If the map is visible and I resize...
Read more >
App Crash on loading Google Maps view [221643638]
We suspect it's likely due to some issue when initializing map surfaces that aren't immediately visible too, as we have a map that's...
Read more >
Why do my apps keep crashing on Android, How to fix it
There can be multiple reasons why apps to freeze or crash, especially when you consider the wide range of chipsets, screen resolutions, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found