Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maxximee opened this issue May 18, 2022 · 0 comments
Open

Comments

@maxximee
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant