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.

TypeError: Cannot read property 'newDrawable' of null

See original GitHub issue

Anytime I add a <CardView></CardView> to anywhere in my app, I get the following error:

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

TypeError: Cannot read property 'newDrawable' of null
File: "file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view/view.js, line: 389, column: 53

StackTrace: 
	Frame: function:'View.(anonymous function)', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 389, column: 54
	Frame: function:'applyAllNativeSetters', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/properties/properties.js', line: 964, column: 95
	Frame: function:'initNativeView', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/properties/properties.js', line: 894, column: 9
	Frame: function:'ViewBase.onResumeNativeUpdates', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 671, column: 22
	Frame: function:'ViewBase._resumeNativeUpdates', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 237, column: 18
	Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 215, column: 14
	Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 62, column: 35
	Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 471, column: 18
	Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 446, column: 14
	Frame: function:'LayoutBaseCommon.insertChild', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 49, column: 14
	Frame: function:'ViewUtil.insertChild', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/nativescript-angular/view-util.js', line: 46, column: 24
	Frame: function:'NativeScriptRenderer.insertBefore', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/nativescript-angular/renderer.js', line: 78, column: 27
	Frame: function:'DebugRenderer2.insertBefore', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 13343, column: 23
	Frame: function:'execRenderNodeAction', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 9086, column: 22
	Frame: function:'visitRenderNode', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 9057, column: 13
	Frame: function:'visitSiblingRenderNodes', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 8988, column: 13
	Frame: function:'visitRootRenderNodes', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 8972, column: 5
	Frame: function:'renderAttachEmbeddedView', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 9786, column: 5
	Frame: function:'attachEmbeddedView', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 9666, column: 5
	Frame: function:'ViewContainerRef_.insert', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 10133, column: 9
	Frame: function:'ViewContainerRef_.createEmbeddedView', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/@angular/core/bundles/core.umd.js', line: 10104, column: 14
	Frame: function:'RadListViewComponent._listView.itemViewLoader', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/nativescript-telerik-ui/listview/angular/listview-directives.js', line: 40, column: 55
	Frame: function:'RadListView.getViewForViewType', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/nativescript-telerik-ui/listview/listview-common.js', line: 412, column: 28
	Frame: function:'ListViewAdapter.onCreateViewHolder', file:'file:///data/data/org.nativescript.PizzaApp/files/app/tns_modules/nativescript-telerik-ui/listview/listview.js', line: 64, column: 33


	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.com.telerik.widget.list.ListViewAdapter_frnal_ts_helpers_l58_c38__ListViewAdapter.onCreateViewHolder(com.telerik.widget.list.ListViewAdapter.java)
	at com.telerik.widget.list.ListViewWrapperAdapter.onCreateViewHolder(ListViewWrapperAdapter.java:459)
	at com.telerik.widget.list.ListViewWrapperAdapter.onCreateViewHolder(ListViewWrapperAdapter.java:20)
	at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6367)
	at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5555)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440)
	at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436)
	at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
	at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
	at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
	at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
	at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583)
	at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3025)
	at com.telerik.widget.list.RadListView.onMeasure(RadListView.java:570)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
	at android.view.View.measure(View.java:19883)
	at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
	at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:83)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
	at android.view.View.measure(View.java:19883)
	at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
	at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1059)
	at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:869)
	at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:279)
	at android.view.View.measure(View.java:19883)
	at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
	at org.nativescript.widgets.ContentLayout.onMeasure(ContentLayout.java:32)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
	at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
	at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6087)
	at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
	at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
	at android.view.View.measure(View.java:19883)
	at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2293)
	at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1384)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1637)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1272)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6408)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
	at android.view.Choreographer.doCallbacks(Choreographer.java:686)
	at android.view.Choreographer.doFrame(Choreographer.java:621)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
	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:6165)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

Using: {N} + Angular(~3.0.0) tns-android 3.1.1 tns --version: 3.1.3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
bradmartincommented, Aug 24, 2017

Hardly the case 😃 I’m a code thief drifting thru this life

3reactions
SP1966commented, Aug 24, 2017

@bradmartin What does it feel like being a rockstar? Us plebes would like to know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'newDrawable' of null #64
Anytime I add a to anywhere in my app, I get the following error: An uncaught Exception occurred on "main" thread. com.tns.
Read more >
TypeError: Cannot read property 'name' of null - Stack Overflow
Your problem is connected to the fact that currentUser does not have a valid value when component is rendered.
Read more >
typeerror can not read property x of null - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
How to fix "TypeError: Cannot read properties of ... - YouTube
JS Casts 12 - How to fix " TypeError : Cannot read properties of null (reading addEventListener)" in JavaScript.
Read more >
TypeError: null is not an object for Zeroconf-React Native
Coding example for the question TypeError: null is not an object for ... React Native : Cannot read property 'isConnected' of undefined (detect...
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