Skip to content

Adding background-color causes crash on Android with nativescript 8.2.2 #142

Open
@maxximee

Description

@maxximee

Checkboxes have a white background color on ios, to fix this, we need to set the background color transparent on the checkbox.
This worked with nativescript 8.0.2, but crashes on nativescript 8.2.2

Error:
System.err: Error: Cannot convert number to Landroid/content/res/ColorStateList; at index 0

How to reproduce:
Set background color to checkbox. Either through css or with the backgroundColor property directly.

Note:
Works on ios, but crashes on android

Full stacktrace:

System.err: Calling js method getView failed
System.err: Error: Cannot convert number to Landroid/content/res/ColorStateList; at index 0
System.err:
System.err: StackTrace:
System.err: _applyBackground(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:910:0)
System.err:     at onBackgroundOrBorderPropertyChanged(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:992:0)
System.err:     at _redrawNativeBackground(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:948:0)
System.err:     at [backgroundInternal:setNative](file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:887:0)
System.err:     at applyAllNativeSetters(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\properties\index.js:1152:0)
System.err:     at initNativeView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\properties\index.js:1079:0)
System.err:     at onResumeNativeUpdates(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:740:22)
System.err:     at _resumeNativeUpdates(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:280:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:235:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\view-common.js:107:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:309:0)
System.err:     at (file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at callFunctionWithSuper(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:312:0)
System.err:     at callLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at loadView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:458:0)
System.err:     at (file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:237:0)
System.err:     at eachChildView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\layouts\layout-base-common.js:101:0)
System.err:     at eachChild(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\view-common.js:772:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:236:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\view-common.js:107:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:309:0)
System.err:     at (file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at callFunctionWithSuper(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:312:0)
System.err:     at callLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at loadView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:458:0)
System.err:     at (file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:237:0)
System.err:     at eachChildView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\layouts\layout-base-common.js:101:0)
System.err:     at eachChild(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\view-common.js:772:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:236:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\view-common.js:107:0)
System.err:     at onLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view\index.android.js:309:0)
System.err:     at (file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at callFunctionWithSuper(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:312:0)
System.err:     at callLoaded(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:318:0)
System.err:     at loadView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:458:0)
System.err:     at _addViewCore(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:453:0)
System.err:     at _addView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\core\view-base\index.js:439:0)
System.err:     at ListViewAdapter.getView(file: src\webpack:\post-card-creator\node_modules\@nativescript\core\ui\list-view\index.android.js:336:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions