Closed NickIliev closed 4 years ago
From @tsonevn on August 9, 2018 6:18
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.
From @psrcek on August 24, 2018 12:43
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"
}
}
From @bachras on September 12, 2018 9:35
I am having same issue as @psrcek
Reproducible with this Playground when tapping on the item at 0 index.
I've managed to pinpoint this error (beware spaghetti code):
https://play.nativescript.org/?template=play-js&id=h0dxyU&v=29
if you use a function as selector, it works as intended, if you don't you'll se that the bindingcontext used is not updating immediatly, but rather a "tick" later:
if (typeof value === "string") {
this._itemTemplateSelectorBindable.bind({
sourceProperty: null,
targetProperty: "templateKey",
expression: value
});
this._itemTemplateSelector = (item: any, index: number, items: any) => {
item["$index"] = index;
this._itemTemplateSelectorBindable.bindingContext = item;
return this._itemTemplateSelectorBindable.get("templateKey");
};
}
For some reason, "expression" is being evaluated later (shouldn't it be synchronous?). I believe this only happens to the first element because it's the first element to be checked after refresh is called (which, again is called in the same "tick" as the change). This can be confirmed by the following sequence of events:
Working as Intended:
1 red {"name":"cloe","age":15,"$index":1} ( 15 and red, good)
1 red {"name":"cloe","age":20,"$index":1} ( 20 and red, just changed)
mudou! 20 1 red (new age 20, red, should be green but binding hasn't updated yet)
0 green {"name":"jan","age":24,"$index":0} (list view starts refreshing)
0 green {"name":"jan","age":24,"$index":0}
0 green {"name":"jan","age":24,"$index":0}
0 green {"name":"jan","age":24,"$index":0}
0 green {"name":"jan","age":24,"$index":0}
0 green {"name":"jan","age":24,"$index":0}
1 green {"name":"cloe","age":20,"$index":1} (by this time, binding has updated, 20 is green)
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
Bad behavior:
0 green {"name":"jan","age":24,"$index":0} (green and 24, good)
1 green {"name":"cloe","age":20,"$index":1} (green and 20, good)
0 green {"name":"jan","age":24,"$index":0} (green and 24, good)
mudou! 15 0 green (changed to 15, should be red but binding hasn't updated yet)
0 green {"name":"jan","age":15,"$index":0} (listview starts refreshing, binding still not updated)
0 green {"name":"jan","age":15,"$index":0}
0 green {"name":"jan","age":15,"$index":0}
0 green {"name":"jan","age":15,"$index":0}
0 green {"name":"jan","age":15,"$index":0}
0 green {"name":"jan","age":15,"$index":0}
0 green {"name":"jan","age":15,"$index":0} (finished updating index 0, still green)
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
1 green {"name":"cloe","age":20,"$index":1}
When this happens, the view is cached in the wrong array key and whatever you do next will likely cause the crash. By the time the next refresh happens, the binding is updated, and it'll try to search for a green view (since it haven't changed color) in the now updated red template key.
Additional info:
When you tap the SECOND item:
bindingContextChange
triggers for 1st and 2nd, even if 1st hasn't changed
When you tap the FIRST item:
bindingContextChange
triggers for 2nd, but not for 1st
Something is preventing this event from being triggered, but I can't find out what.
https://play.nativescript.org/?template=play-js&id=h0dxyU&v=31
In the example, I'm manually triggering a bindingContextChange event just before querying the item template. which makes the listview work flawlessly.
if you comment:
// COMMENT THIS LINE FOR CRASH!
esse._itemTemplateSelectorBindable.notify({ eventName: "bindingContextChange", object: esse._itemTemplateSelectorBindable, propertyName: "bindingContext", value: dataItem });
you can check the current behavior (the logs will show you that after the "mudou" console line, which indicates the change has been made, the binding context event is not triggered for the first item).
I couldn't find where the bindingContextChange event is triggered, so I couldn't progress any further.
@NickIliev, I'm still having that issue with 5.4.0 Android runtime.
When I'm trying to use multiple templates within ListView
the app crashes with:
System.err: com.tns.NativeScriptException:
System.err: Calling js method getView failed
System.err:
System.err: TypeError: Cannot read property 'get' of undefined
System.err: File: "file:///data/data/app.feedme.mobile/files/app/vendor.js, line: 110398, column: 62
System.err:
System.err: StackTrace:
System.err: Frame: function:'ListViewAdapter.getView', file:'file:///data/data/app.feedme.mobile/files/app/vendor.js', line: 110398, column: 63
...
@romandragan use the latest tns-core-modules (that might require updating to the latest CLI and running
tns migrate` afterward)
@NickIliev, still an issue with the latest tns-core-modules@6.0.3
, tns-android@6.0.1
and nativescript-vue@2.4.0
.
@romandragan I've tested multiple templates via this Playground (tns-core-modules@6.0.1) and everything is working as expected. Provide a demo project so we could investigate your specific case.
@NickIliev, thanks, it works for me now. The problem was occuring if we have ListView
under v-if
condition, once I changed it to v-show
or removed the condition completely — the issue disappears.
However, I noticed a big difference in performance with multiple v-template
's for Android and iOS. I mean it works smoothly on Android, but a kind of very laggy on iOS.
FYI switching to RadListView
partially solves performance problem on iOS, but I don't think that's the only option we should have.
@NickIliev It appears this bug was fixed in a newer version of the NS core-modules and framework. For those of us not able to upgrade to 6.x core-modules at this time, is @romandragan or @edusperoni work around the only valid way to go?
@spstratis, you mean it has been fixed in 6.3.0 version?
@romandragan I was basing it on this https://github.com/NativeScript/NativeScript/pull/6634, Which actually looks to be well before 6.3.0
What version of NS were you running for your work around?
@NickIliev Is there a way to work around this issue if my app must remain on the 5.4.3 version of the core-modules for the time being? We're seeing pretty consistent crashes on Android right now because of this problem. We're using Core TNS, not Vue or Angular. Thanks for any info!
@spstratis - 6.3.x supports NS Core great. Any specific reason you are stuck on 5.4? I had an app that was stuck on NS 2 for a long time. Upgraded it to NS 5, then finally, upgraded it to NS 6; was the best decision we could have made! Staying out of date was becoming a serious pain/time sync to maintain because of multiple issues like this. I had a whole list of "patches" I was manually merging.
If you are truly stuck on 5.4, then you need to manually patch your tns core modules, with some of the suggestions earlier in the thread. But remember, staying on NS 5.4; your app might have other issues (especially with ios 13) because you are missing a huge number of fixes that came about in the 13 releases since the version you are running.
@NathanaelA Thanks for the feedback! We weren't upgrading due to concerns around plugin support, a lot seemed to have moved behind a paywall in order to get the 6.x updates. It does seem with the newer version of 6.x they introduced a migrate function into the CLI that may help with the transition. We're just not at a point right now where we feel we can comfortably upgrade and still test everything out before our release date.
@spstratis - I don't speak for the Progress or the NativeScript team -- but I've been around since the beginning. :grin: But no one supports the ancient versions (v6.3 is 13 releases since the last 5.4, some major) -- the whole objective of NativeScript is to move forward. Which means bugs in v5 will remain unfixed in v5 unless you manually fix it yourself or you pay someone (Progress has enterprise contracts, nStudio has service contracts).
As for the plugins -- yes, you are correct multiple plugins went behind the paywall; because none of those developers get paid (except now via the proplugins) for any time spent on them, and none of the community was really helping support them. So all the work to maintain those 40+ plugins is being done by a very small group of people taking time from their families for no benefit. Now, at least these developers now make a little bit of cash each month to justify doing all this work.
But considering most companies spend somewhere between 30k-200k per year for a developer; and ALL 40+ plugins are only $120 total a year. The amount of time a developer wastes staying on NS 5, vs upgrading will cost way way more in labor than a yearly fee. Example: Say you, a developer made 100k a year. (numbers ignoring all the extra money a company spends on you for taxes, health, and other benefits the company offers) That developer wasting just 3.5 hours on a single NS 5 issue that is fixed in NS 6, is enough to have paid for the entire year's plugin subscription. :grinning:
The cost of a subscription vs a developers labor cost is truly a steal and on top of that those that do subscribe help pay for the ongoing costs of maintenance on all these plugins so they continue to work in the future too. Pretty much a win-win scenario for everyone involved.
hey, @NathanaelA a lot has changed since this discussion but I am still seeing this issue on NS 6 with Angular. Those are my versions:
"tns-ios": {
"version": "6.5.2"
},
"tns-android": {
"version": "6.5.3"
}
"tns-core-modules": "^6.5.15",
Do you have an update on this, or a new possible solution?
StackTrace:
JS: Calling js method getView failed
JS: Error: There is no entry with key 'org.nativescript.widgets.StackLayout{35ac271 V.E...... ......ID 0,963-1080,1121}' in the realized views cache for template with key'alternative-trips-result'.
JS: ZoneAwareError(file: node_modules/@nativescript/angular/zone-js/dist/zone-nativescript.js:1298:0)
JS: at (file: node_modules/@nativescript/core/ui/list-view/list-view.android.js:243:0)
JS: at com.tns.Runtime.callJSMethodNative(Native Method)
JS: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
JS: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
JS: at com.tns.Runtime.callJSMethod(Runtime.java:1160)
JS: at com.tns.Runtime.callJSMethod(Runtime.java:1138)
JS: at com.tns.Runtime.callJSMethod(Runtime.java:1134)
JS: at com.tns.gen.android.widget.BaseAdapter_vendor_120306_32_ListViewAdapter.getView(BaseAdapter_vendor_120306_32_ListViewAdapter.java:39)
JS: at android.widget.AbsListView.obtainView(AbsListView.java:2425)
JS: at android.widget.ListView.makeAndAddView(ListView.java:2102)
JS: at android.widget.ListView.fillDown(ListView.java:817)
JS: at android.widget.ListView.fillSpecific(ListView.java:1528)
JS: at android.widget.ListView.originalLayoutChildren(ListView.java:1837)
JS: at android.widget.ListView.layoutChildren(ListView.java:1666)
JS: at android.widget.AbsListView...
System.err: An uncaught Exception occurred on "main" thread.
System.err: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
System.err:
System.err: StackTrace:
System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
System.err: at android.widget.AbsListView.setItemViewLayoutParams(AbsListView.java:2480)
System.err: at android.widget.AbsListView.obtainView(AbsListView.java:2429)
System.err: at android.widget.ListView.makeAndAddView(ListView.java:2102)
System.err: at android.widget.ListView.fillDown(ListView.java:817)
System.err: at android.widget.ListView.fillSpecific(ListView.java:1528)
System.err: at android.widget.ListView.originalLayoutChildren(ListView.java:1837)
System.err: at android.widget.ListView.layoutChildren(ListView.java:1666)
System.err: at android.widget.AbsListView.onLayout(AbsListView.java:2236)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at androidx.swiperefreshlayout.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:625)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.StackLayout.layoutVertical(StackLayout.java:178)
System.err: at org.nativescript.widgets.StackLayout.onLayout(StackLayout.java:132)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.ContentLayout.onLayout(ContentLayout.java:73)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.ContentLayout.onLayout(ContentLayout.java:73)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.ContentLayout.onLayout(ContentLayout.java:73)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.ContentLayout.onLayout(ContentLayout.java:73)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
System.err: at com.android.internal.policy.DecorView.onLayout(DecorView.java:811)
System.err: at android.view.View.layout(View.java:22169)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6333)
System.err: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3170)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2680)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1800)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7792)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:854)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:789)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016)
System.err: at android.os.Handler.handleCallback(Handler.java:883)
System.err: at android.os.Handler.dispatchMessage(Handler.java:100)
System.err: at android.os.Looper.loop(Looper.java:224)
System.err: at android.app.ActivityThread.main(ActivityThread.java:7551)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
To my knowledge all listview issues were fixin during the NS6 time frame. However it appears you somehow managed to trigger a issue with a SwipeRefreshLayout -- are you able to duplicate this easily?
not really. we still did not find a way to reliable trigger it within our app. But we are using a rather complex setup where we have a nativescript-carousel and each CarouselItem contains one ListView. Maybe we can find the time to reproduce it.
I can confirm this still happens on NS7. I can see it happens in production via logs, but I am unable to reproduce it yet.
EDIT:
@NickIliev the PR that closed this issue might have solved one of the potential causes, but I can see it still happening on @nativescript/core@7.0.12
, the issue should be reopened. Interestingly enough it wasn't happening for us on 6.x, but after the upgrade I can see a lot of crashes with that error. And I am unable to reproduce.
I've reopened this issue as I have identified this still happens on very rare occasions where the items where updated while the view is in a suspended state (different page, app on background, screen turned off...).
I've identified the issue and should open a PR shortly to address it.
Error: Calling js method getView failed
TypeError: Cannot read property 'get' of undefined
Error: Calling js method onItemClick failed
TypeError: Cannot read property 'get' of undefined
I get a lot of these errors in the logs. owner._realizedTemplates.get(template.key)
returns undefined
@hamorphis do you by chance remember the reasoning behind this line https://github.com/NativeScript/NativeScript/blob/6.5.19/nativescript-core/ui/list-view/list-view.android.ts#L287 why does it have to throw instead of creating a new view with template.createView()
?
Hello everyone.
These problems also happen to me frequently. Even updating to the latest version 7.x of Nativescrip.
Hope we can solve this problem together. I have been suffering from this type of bugs for 4 years, and I can not find the solution.
System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method getView failed System.err: Error: There is no entry with key 'org.nativescript.widgets.StackLayout{592520a V.E...... ........ 0,-445-1440,46}' in the realized views cache for template with key'image'. System.err: System.err: StackTrace: System.err: ListViewAdapter.getView(file: node_modules/@nativescript/core/ui/list-view/list-view.android.js:243:0) System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1160) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1138) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1134) System.err: at com.tns.gen.android.widget.BaseAdapter_vendor_28514_32_ListViewAdapter.getView(BaseAdapter_vendor_28514_32_ListViewAdapter.java:39) System.err: at android.widget.AbsListView.obtainView(AbsListView.java:2365) System.err: at android.widget.ListView.makeAndAddView(ListView.java:2052) System.err: at android.widget.ListView.fillUp(ListView.java:820) System.err: at android.widget.ListView.fillGap(ListView.java:759) System.err: at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5225) System.err: at android.widget.ListView.trackMotionScroll(ListView.java:1971) System.err: at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3574) System.err: at android.widget.AbsListView.onTouchMove(AbsListView.java:3983) System.err: at android.widget.AbsListView.onTouchEvent(AbsListView.java:3808) System.err: at android.view.View.dispatchTouchEvent(View.java:11776) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2962) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2643) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2657) System.err: at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:448) System.err: at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1829) System.err: at android.app.Activity.dispatchTouchEvent(Activity.java:3307) System.err: at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69) System.err: at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410) System.err: at android.view.View.dispatchPointerEvent(View.java:12015) System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4795) System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200) System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166) System.err: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293) System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174) System.err: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4200) System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4166) System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4174) System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4147) System.err: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6661) System.err: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6635) System.err: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6596) System.err: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6764) System.err: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:186) System.err: at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) System.err: at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:177) System.err: at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6735) System.err: at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6787) System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:723) System.err: at android.view.Choreographer.doFrame(Choreographer.java:652) System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) System.err: at android.os.Handler.handleCallback(Handler.java:790) System.err: at android.os.Handler.dispatchMessage(Handler.java:99) System.err: at android.os.Looper.loop(Looper.java:164) System.err: at android.app.ActivityThread.main(ActivityThread.java:6494) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
@vicmasa I'm positive that you are not in the latest 7.x Nativescript version as this regression (not the same bug as 4 years ago) was fixed in 7.1 and that error message is no longer in the codebase, so it's not possible for it to show on >=7.1.0
Hello everyone, the problem occurs whenever you have a listView with several components inside. I hope you can help us. Thanks.
An uncaught Exception occurred on "main" thread. Calling js method getView failed Error: There is no entry with key 'org.nativescript.widgets.GridLayout{54a6698 V.E...... ........ 0,-313-1080,27}' in the realized views cache for template with key'title'.
StackTrace: ListViewAdapter.getView(file:///data/data/org.invianinternational.ViiAManager/files/app/vendor.js:28612:27) at com.tns.Runtime.callJSMethodNative(Native Method) at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286) at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173) at com.tns.Runtime.callJSMethod(Runtime.java:1160) at com.tns.Runtime.callJSMethod(Runtime.java:1138) at com.tns.Runtime.callJSMethod(Runtime.java:1134) at com.tns.gen.android.widget.BaseAdapter_vendor_28566_32_ListViewAdapter.getView(BaseAdapter_vendor_28566_32_ListViewAdapter.java:39) at android.widget.AbsListView.obtainView(AbsListView.java:2494) at android.widget.HwAbsListView.obtainView(HwAbsListView.java:1139) at android.widget.ListView.makeAndAddView(ListView.java:2119) at android.widget.ListView.fillUp(ListView.java:853) at android.widget.ListView.fillGap(ListView.java:785) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5646) at android.widget.ListView.trackMotionScroll(ListView.java:2013) at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:5152) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1057) at android.view.Choreographer.doCallbacks(Choreographer.java:875) at android.view.Choreographer.doFrame(Choreographer.java:772) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042) at android.os.Handler.handleCallback(Handler.java:888) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8178) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Hi everyone,
I'm also facing this issue on some phones. I tried to live debug on all the phones I can easily access but none of them has this issue.
I only have some logs from the store returned by the affected users. I build the app with @nativescript/android v. 8.0.0.
Any news or idea on what could be the cause? Did you fix it on your own projects?
Thx for your passion and your time!
Error: at com.tns.Runtime.callJSMethodNative (Native Method) at com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1302) at com.tns.Runtime.callJSMethodImpl (Runtime.java:1188) at com.tns.Runtime.callJSMethod (Runtime.java:1175) at com.tns.Runtime.callJSMethod (Runtime.java:1153) at com.tns.Runtime.callJSMethod (Runtime.java:1149) at com.tns.gen.android.widget.BaseAdapter_vendor_115393_28_ListViewAdapter.getView (BaseAdapter_vendor_115393_28_ListViewAdapter.java:39) at android.widget.AbsListView.obtainView (AbsListView.java:2412) at android.widget.ListView.makeAndAddView (ListView.java:2071) at android.widget.ListView.fillDown (ListView.java:797) at android.widget.ListView.fillFromTop (ListView.java:859) at android.widget.ListView.layoutChildren (ListView.java:1814) at android.widget.AbsListView.onLayout (AbsListView.java:2202) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at org.nativescript.widgets.CommonLayoutParams.layoutChild (CommonLayoutParams.java:222) at org.nativescript.widgets.GridLayout.onLayout (GridLayout.java:354) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at org.nativescript.widgets.CommonLayoutParams.layoutChild (CommonLayoutParams.java:222) at org.nativescript.widgets.GridLayout.onLayout (GridLayout.java:354) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at org.nativescript.widgets.CommonLayoutParams.layoutChild (CommonLayoutParams.java:222) at org.nativescript.widgets.ContentLayout.onLayout (ContentLayout.java:73) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332) at android.widget.FrameLayout.onLayout (FrameLayout.java:270) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332) at android.widget.FrameLayout.onLayout (FrameLayout.java:270) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332) at android.widget.FrameLayout.onLayout (FrameLayout.java:270) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1829) at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1673) at android.widget.LinearLayout.onLayout (LinearLayout.java:1582) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332) at android.widget.FrameLayout.onLayout (FrameLayout.java:270) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1829) at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1673) at android.widget.LinearLayout.onLayout (LinearLayout.java:1582) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.widget.FrameLayout.layoutChildren (FrameLayout.java:332) at android.widget.FrameLayout.onLayout (FrameLayout.java:270) at com.android.internal.policy.DecorView.onLayout (DecorView.java:799) at android.view.View.layout (View.java:21973) at android.view.ViewGroup.layout (ViewGroup.java:6263) at android.view.ViewRootImpl.performLayout (ViewRootImpl.java:3111) at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2621) at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1752) at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:7695) at android.view.Choreographer$CallbackRecord.run (Choreographer.java:966) at android.view.Choreographer.doCallbacks (Choreographer.java:790) at android.view.Choreographer.doFrame (Choreographer.java:725) at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:951) at android.os.Handler.handleCallback (Handler.java:883) at android.os.Handler.dispatchMessage (Handler.java:100) at android.os.Looper.loop (Looper.java:241) at android.app.ActivityThread.main (ActivityThread.java:7617) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:941)
From @tsonevn on August 9, 2018 6:18
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:
Please provide the following version numbers that your issue occurs with:
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
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-runtime#1145
Copied from original issue: NativeScript/NativeScript#6166
Copied from original issue: NativeScript/nativescript-angular#1479