Nativescript-ui-feedback: RadListView items with async pipe can cause crash

Created on 20 Nov 2017  Â·  7Comments  Â·  Source: ProgressNS/nativescript-ui-feedback

Did you verify this is a real problem by searching Stack Overflow?

_Yes_

Tell us about the problem

On Android, RadListView crashes when using with the async pipe and a header or footer. This appears to happen when there is a delay of somewhere just over 100 ms. I consistently observe the crash when I delay the data by 150 ms.

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

```{
"description": "NativeScript Application",
"license": "SEE LICENSE IN ",
"readme": "NativeScript Application",
"repository": "",
"nativescript": {
"id": "org.nativescript.radlistviewfooterbug",
"tns-android": {
"version": "3.3.0"
}
},
"dependencies": {
"@angular/animations": "~4.4.6",
"@angular/common": "~4.4.6",
"@angular/compiler": "~4.4.6",
"@angular/core": "~4.4.6",
"@angular/forms": "~4.4.6",
"@angular/http": "~4.4.6",
"@angular/platform-browser": "~4.4.6",
"@angular/platform-browser-dynamic": "~4.4.6",
"@angular/router": "~4.4.6",
"nativescript-angular": "~4.4.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.4.3",
"tns-core-modules": "~3.3.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.5.0",
"typescript": "~2.4.2"
}
}


Android Stack Trace:

System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.telerik.widget.list.RadListView.behaviors()' on a null object reference
System.err: at com.telerik.widget.list.ListViewWrapperAdapter.getItemViewType(ListViewWrapperAdapter.java:344)
System.err: at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5549)
System.err: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5482)
System.err: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5478)
System.err: at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2215)
System.err: at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1542)
System.err: at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1502)
System.err: at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
System.err: at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3625)
System.err: at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3067)
System.err: at com.telerik.widget.list.RadListView.onMeasure(RadListView.java:605)
System.err: at android.view.View.measure(View.java:19857)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at android.view.View.measure(View.java:19857)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
System.err: at android.view.View.measure(View.java:19857)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1055)
System.err: at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:865)
System.err: at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
System.err: at android.view.View.measure(View.java:19857)
System.err: at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err: at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
System.err: at android.view.View.measure(View.java:19857)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at android.view.View.measure(View.java:19857)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
System.err: at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
System.err: at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
System.err: at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
System.err: at android.view.View.measure(View.java:19857)
System.err: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
System.err: at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
System.err: at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
System.err: at android.view.View.measure(View.java:19857)
System.err: at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
System.err: at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:686)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:621)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
System.err: at android.os.Handler.handleCallback(Handler.java:751)
System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: at android.os.Looper.loop(Looper.java:154)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6119)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
ActivityManager: Process org.nativescript.radlistviewfooterbug (pid 8872) has died
```

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

I'm including a sample project. The crash can be consistently observed when the delay on items$ in items.component.ts is above 150. Occurs with both header and footer directives. I have not tried to reproduce this issue outside of Angular.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

rad-list-view-footer-bug.zip

backlog bug listview android high

All 7 comments

@vcooley thank you for reporting this issue - I can confirm that indeed the case is reproducible with the provided application.

@VladimirAmiorkov @tgpetrov the issue is reproducible only when footer and/or header are introduces and when the delay method of rxjs is used (no setTimeOut)

I’d like to expand on that by saying that I found the issue because of a
network request taking more than about 100 ms, but used the delay method to
show a reproduction.
On Mon, Dec 11, 2017 at 10:49 PM Nick Iliev notifications@github.com
wrote:

@VladimirAmiorkov https://github.com/vladimiramiorkov @tgpetrov
https://github.com/tgpetrov the issue is reproducible only when footer
and/or header are introduces and when the delay method of rxjs is used
(no setTimeOut)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/telerik/nativescript-ui-feedback/issues/410#issuecomment-350960890,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AL-D5UdtChVlczboZcnXlAmSHWumVj9mks5s_iHsgaJpZM4QkXB2
.

When using a drawer navigation, and you navigate away from the radlistview and back it will also crash. I just removed the footer for now to prevent this behaviour.

Released in v3.5.1

Hi @zbranzov, thank you very much. I've upgraded to 3.5.1 and it's working now !

Was this page helpful?
0 / 5 - 0 ratings