Skip to content

ListView causing app to crash  #1479

Closed
Closed

Description

@tsonevn

From @vtrifonov on August 8, 2018 15:7

From @ludcila on August 8, 2018 14:21

Please, provide the details below:

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes

Found some similar issues:

Tell us about the problem

The app crashes when:

  1. Using a ListView with multiple templates
  2. There is a model update that causes an item to switch from one template to another
  3. The app is put into background and/or navigation occurs (using slide transition)

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.1.2
  • Cross-platform modules: 4.1.1
  • Runtime(s): 4.1.3

This seems to happen only on Android 8.0.

Did the error happen while the app was being constructed? (buildtime error)

No

Did the error happen while the app was executing? (runtime error)

Yes

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

Error: There is no entry with key 'org.nativescript.widgets.StackLayout{4b534d0 V.E...... ........ 0,-133-1080,28}' in the realized views cache for template with key'visited'.
File: "file:///data/data/org.nativescript.nsissue741/files/app/tns_modules/tns-core-modules/ui/list-view/list-view.js, line: 241, column: 20

StackTrace: 
	Frame: function:'ZoneAwareError', file:'file:///data/data/org.nativescript.nsissue741/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 1298, column: 33
	Frame: function:'ListViewAdapter.getView', file:'file:///data/data/org.nativescript.nsissue741/files/app/tns_modules/tns-core-modules/ui/list-view/list-view.js', line: 241, column: 27


	at com.tns.Runtime.callJSMethodNative(Native Method)
	at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
	at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
	at com.tns.Runtime.callJSMethod(Runtime.java:970)
	at com.tns.Runtime.callJSMethod(Runtime.java:954)
	at com.tns.Runtime.callJSMethod(Runtime.java:946)
	at com.tns.gen.android.widget.BaseAdapter_view_195_32_ListViewAdapter.getView(BaseAdapter_view_195_32_ListViewAdapter.java:52)
	at android.widget.AbsListView.obtainView(AbsListView.java:2428)
	at android.widget.ListView.makeAndAddView(ListView.java:2083)
	at android.widget.ListView.fillUp(ListView.java:829)
	at android.widget.ListView.fillGap(ListView.java:766)
	at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5520)
	at android.widget.ListView.trackMotionScroll(ListView.java:1991)
	at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3660)
	at android.widget.AbsListView.onTouchMove(AbsListView.java:4086)
	at android.widget.AbsListView.onTouchEvent(AbsListView.java:3904)
	at android.view.View.dispatchTouchEvent(View.java:11788)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2647)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2974)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2661)
	at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:549)
	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1953)
	at android.app.Activity.dispatchTouchEvent(Activity.java:3548)
	at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:502)
	at android.view.View.dispatchPointerEvent(View.java:12027)
	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5278)
	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5067)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4581)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4634)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4600)
	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4727)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4608)
	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4784)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4581)
	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4634)
	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4600)
	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4608)
	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4581)
	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7169)
	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7143)
	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7104)
	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7325)
	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:192)
	at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
	at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:181)
	at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:7248)
	at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:7353)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:981)
	at android.view.Choreographer.doCallbacks(Choreographer.java:790)
	at android.view.Choreographer.doFrame(Choreographer.java:715)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
	at android.os.Handler.handleCallback(Handler.java:808)
	at android.os.Handler.dispatchMessage(Handler.java:101)
	at android.os.Looper.loop(Looper.java:166)
	at android.app.ActivityThread.main(ActivityThread.java:7425)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Please tell us how to recreate the issue in as much detail as possible.

Sample project to reproduce the issue:
https://github.com/ludcila/ns-listview-issue

Copied from original issue: NativeScript/android#1145

Copied from original issue: NativeScript/NativeScript#6166

Activity

  1. tsonevn commented on Aug 9, 2018

    @tsonevn
    ContributorAuthor

    Hi @ludcila,
    Thank you for the provided sample project.
    I tested it on my side and was able to recreate the problem. I will mark this as a bug. For now, I would suggest, to keep track of the issue for further info.

  2. self-assigned this
    on Aug 9, 2018
  3. added this to the 6.2 (TBD) milestone on Aug 14, 2018
  4. davidpanic commented on Aug 24, 2018

    @davidpanic

    Can confirm this, occurs when an item switches templates while not on screen.
    tns --version: 4.2.2
    package.json:

    {
      "description": "[removed]",
      "readme": "SEE README.md",
      "repository": "[removed]",
      "nativescript": {
        "id": "[removed]",
        "tns-ios": {
          "version": "4.1.0"
        },
        "tns-android": {
          "version": "4.2.0"
        }
      },
      "dependencies": {
        "@angular/animations": "~6.1.0",
        "@angular/common": "~6.1.0",
        "@angular/compiler": "~6.1.0",
        "@angular/core": "~6.1.0",
        "@angular/forms": "~6.1.0",
        "@angular/http": "~6.1.0",
        "@angular/platform-browser": "~6.1.0",
        "@angular/platform-browser-dynamic": "~6.1.0",
        "@angular/router": "~6.1.0",
        "allow-publish": "^1.0.4",
        "base-64": "^0.1.0",
        "nativescript-angular": "^6.1.0",
        "nativescript-bitmap-factory": "^1.7.1",
        "nativescript-camera": "^4.0.2",
        "nativescript-imagecropper": "^1.0.4",
        "nativescript-iqkeyboardmanager": "^1.3.0",
        "nativescript-loading-indicator": "^2.4.0",
        "nativescript-localstorage": "^1.1.5",
        "nativescript-modal-datetimepicker": "^1.1.3",
        "nativescript-permissions": "^1.2.3",
        "nativescript-phone": "^1.3.1",
        "nativescript-plugin-firebase": "file:./nativescript-plugin-firebase-6.5.0.tgz",
        "nativescript-share-file": "^1.0.4",
        "nativescript-theme-core": "^1.0.4",
        "nativescript-toast": "^1.4.6",
        "nativescript-ui-calendar": "^3.7.0",
        "nativescript-ui-sidedrawer": "^4.2.0",
        "reflect-metadata": "^0.1.8",
        "rxjs": "^6.0.0",
        "tns-core-modules": "^4.2.0",
        "zone.js": "^0.8.26"
      },
      "devDependencies": {
        "@angular/compiler-cli": "~6.1.0",
        "@ngtools/webpack": "~6.1.0",
        "babel-traverse": "6.4.5",
        "babel-types": "6.4.5",
        "babylon": "6.4.5",
        "lazy": "1.0.11",
        "nativescript-dev-sass": "^1.6.0",
        "nativescript-dev-typescript": "^0.7.3",
        "nativescript-dev-webpack": "^0.15.1",
        "tns-platform-declarations": "^3.4.1",
        "typescript": "~2.7.2"
      }
    }
    
  5. bachras commented on Sep 12, 2018

    @bachras

    I am having same issue as @psrcek

  6. NickIliev commented on Sep 19, 2018

    @NickIliev

    Reproducible with this Playground when tapping on the item at 0 index.

  7. NickIliev commented on Sep 20, 2018

    @NickIliev

    This issue was moved to NativeScript/NativeScript#6284

  8. ghost removed on Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions