Nativescript: ListPicker crash on Android on NS 6.1

Created on 24 Sep 2019  路  33Comments  路  Source: NativeScript/NativeScript

Environment

  • CLI: 6.1
  • Cross-platform modules: 6.1.1
  • Android Runtime: 6.1.1
  • iOS Runtime: 6.1.0
  • Plugin(s):
    "nativescript-advanced-webview": "^3.0.2",
    "nativescript-angular": "^8.2.1",
    "nativescript-canvas": "^2.1.5",
    "nativescript-datetimepicker": "^1.2.1",
    "nativescript-drop-down": "^5.0.0",
    "nativescript-feedback": "^1.3.9",
    "nativescript-http-formdata": "^1.7.0",
    "nativescript-imagecropper": "^1.0.5",
    "nativescript-intl": "^3.0.0",
    "nativescript-iqkeyboardmanager": "^1.5.1",
    "nativescript-localize": "^4.1.1",
    "nativescript-mediafilepicker": "^2.0.16",
    "nativescript-pager": "^11.0.9",
    "nativescript-permissions": "^1.3.7",
    "nativescript-phone": "^1.4.0",
    "nativescript-platform-css": "^1.6.9",
    "nativescript-plugin-firebase": "^9.0.4",
    "nativescript-sqlite": "^2.3.3",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-listview": "^7.0.5",
    "nativescript-ui-sidedrawer": "7.0.0",

Describe the bug
The ListPicker is working on iOS but not on Android, when i try to load a Page with a ListPicker on it i get the error:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onCreateView failed
System.err: TypeError: this.nativeView.getTextColor is not a function
System.err: 
System.err: StackTrace:
System.err:     push.../node_modules/tns-core-modules/ui/list-picker/list-picker.js.ListPicker.<computed>(file:///node_modules/tns-core-modules/ui/list-picker/list-picker.js:139:0)
System.err:     at applyAllNativeSetters(file:///node_modules/tns-core-modules/ui/core/properties/properties.js:1060:0)
System.err:     at initNativeView(file:///node_modules/tns-core-modules/ui/core/properties/properties.js:990:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onResumeNativeUpdates(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:628:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase._resumeNativeUpdates(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:273:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:232:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/content-view/content-view.js.ContentView.eachChildView(file:///node_modules/tns-core-modules/ui/content-view/content-view.js:70:0)
System.err:     at push.../node_modules/tns-core-modules/ui/page/page-common.js.PageBase.eachChildView(file:///node_modules/tns-core-modules/ui/page/page-common.js:126:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at push.../node_modules/tns-core-modules/ui/page/page.js.Page.onLoaded(file:///node_modules/tns-core-modules/ui/page/page.js:43:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase._addViewCore(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:435:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase._addView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:421:0)
System.err:     at push.../node_modules/tns-core-modules/ui/frame/frame.js.FragmentCallbacksImplementation.onCreateView(file:///node_modules/tns-core-modules/ui/frame/frame.js:687:0)
System.err:     at push.../node_modules/tns-core-modules/ui/frame/fragment.js.FragmentClass.onCreateView(file:///node_modules/tns-core-modules/ui/frame/fragment.js:26:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err:     at com.tns.FragmentClass.onCreateView(FragmentClass.java:53)
System.err:     at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2595)
System.err:     at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
System.err:     at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
System.err:     at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
System.err:     at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
System.err:     at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2076)
System.err:     at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1866)
System.err:     at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1821)
System.err:     at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
System.err:     at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
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:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7343)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:933)

Searching in the code of this repository the problem appears to happen in the file tns-core-modules/ui/list-picker/list-picker.android.ts line 175.

To Reproduce
Simply put a ListPicker with items in a page in an Angular project and run it on an Android Emulator API 29.

Expected behavior
No error trying to use the ListPicker on Android projects.

bug android

Most helpful comment

Hello ! I have the same problem with the ListPicker here, however i don't know how to update the compileSdkVersion and the buildToolsVersion on my project ! Someone here can help me out ? Thanks :)

In your app.gradle file you should have something like this....

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 23
targetSdkVersion 29
generatedDensities = []
///MUST BE SAME AS ANDROIDMANIFEST.XML
applicationId "you app info"
versionCode 7
versionName "505357"
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86_64"
}
}

All 33 comments

Hi @darkyelox,
I tested the described case with our nativescript-sdk-examples-ng while using the latest {N}. However, I was unable to recreate the crash. On that matter, can you provide more info about the problem and how to recreate it? Also, you can check the SDK example and verify if you will be able to reproduce the issue.

Hi,

I beleive I'm having the same issue after upgrading my phone to andoid 10 the app I'm working on crashes as it contains ListPicker controls. I made a simple app to reproduce this issue which I've pushed here. It seems to be enough to just try to display a ListPicker.

Let me know if I can help you recreate this.

Thanks

I had this exact issue earlier today while testing my app on an Android 10 device. Fixed it by updating android sdk build tools from 28.0.3 to 29.0.2.

HI @davidcorne
I tested the linked project on my side. However, I am still unable to recreate the issue. Have you tried the solution suggested by @p-ranav?

Closing due to inactivity

Sorry for don't answer in all that time, i was a little busy, can you reopen the issue?, i updated my sdk tools to 29.0.2 and also updated android API 29 and recreate my emulator with that API level, using the latest tns-core-modules and android runtime with version 6.1.2, but still having this problem in Android 10 but still having the same:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method setPrimaryItem failed
System.err: TypeError: this.nativeView.getTextColor is not a function
System.err: 
System.err: StackTrace:
System.err:     push.../node_modules/tns-core-modules/ui/list-picker/list-picker.js.ListPicker.<computed>(file:///node_modules/tns-core-modules/ui/list-picker/list-picker.js:139:0)
System.err:     at applyAllNativeSetters(file:///node_modules/tns-core-modules/ui/core/properties/properties.js:1060:0)
System.err:     at initNativeView(file:///node_modules/tns-core-modules/ui/core/properties/properties.js:990:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onResumeNativeUpdates(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:628:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase._resumeNativeUpdates(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:273:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:232:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:234:0)
System.err:     at push.../node_modules/tns-core-modules/ui/layouts/layout-base-common.js.LayoutBaseCommon.eachChildView(file:///node_modules/tns-core-modules/ui/layouts/layout-base-common.js:125:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view-common.js.ViewCommon.eachChild(file:///node_modules/tns-core-modules/ui/core/view/view-common.js:1010:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.onLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:233:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view/view.js.View.onLoaded(file:///node_modules/tns-core-modules/ui/core/view/view.js:246:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:75)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callFunctionWithSuper(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:305:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.callLoaded(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:312:0)
System.err:     at push.../node_modules/tns-core-modules/ui/core/view-base/view-base.js.ViewBase.loadView(file:///node_modules/tns-core-modules/ui/core/view-base/view-base.js:440:0)
System.err:     at push.../node_modules/tns-core-modules/ui/tab-view/tab-view-common.js.TabViewItemBase.loadView(file:///node_modules/tns-core-modules/ui/tab-view/tab-view-common.js:82:0)
System.err:     at (file:///node_modules/tns-core-modules/ui/tab-view/tab-view.js:429:0)
System.err:     at push.../node_modules/tns-core-modules/ui/tab-view/tab-view.js.TabView._loadUnloadTabItems(file:///node_modules/tns-core-modules/ui/tab-view/tab-view.js:426:0)
System.err:     at FragmentPagerAdapter.setPrimaryItem(file:///node_modules/tns-core-modules/ui/tab-view/tab-view.js:149:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err:     at com.tns.gen.androidx.viewpager.widget.PagerAdapter_vendor_200981_32_FragmentPagerAdapter.setPrimaryItem(PagerAdapter_vendor_200981_32_FragmentPagerAdapter.java:54)
System.err:     at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1234)
System.err:     at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
System.err:     at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1056)
System.err:     at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:866)
System.err:     at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:280)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:87)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.StackLayout.onMeasure(StackLayout.java:87)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.AbsoluteLayout.onMeasure(AbsoluteLayout.java:33)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1056)
System.err:     at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:866)
System.err:     at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:280)
System.err:     at android.view.View.measure(View.java:24530)
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:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at org.nativescript.widgets.CommonLayoutParams.measureChild(CommonLayoutParams.java:262)
System.err:     at org.nativescript.widgets.MeasureHelper.measureChildFixedColumnsAndRows(GridLayout.java:1056)
System.err:     at org.nativescript.widgets.MeasureHelper.measure(GridLayout.java:866)
System.err:     at org.nativescript.widgets.GridLayout.onMeasure(GridLayout.java:280)
System.err:     at android.view.View.measure(View.java:24530)
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:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err:     at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
System.err:     at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
System.err:     at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
System.err:     at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
System.err:     at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
System.err:     at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
System.err:     at com.android.internal.policy.DecorView.onMeasure(DecorView.java:737)
System.err:     at android.view.View.measure(View.java:24530)
System.err:     at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2997)
System.err:     at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1826)
System.err:     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2115)
System.err:     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1714)
System.err:     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7587)
System.err:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
System.err:     at android.view.Choreographer.doCallbacks(Choreographer.java:790)
System.err:     at android.view.Choreographer.doFrame(Choreographer.java:725)
System.err:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
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:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7343)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:933)

Sorry my bad, i have to also delete node_modules for take the latest changes now is working fine, keep it closed

@tsonevn I am still seeing this issue.

tns-core-modules: 6.1.2
device: Android Pixel 2, Android 10

JS: '{NSVue (Vue: 2.6.10 | NSVue: 2.4.0)} -> CreateElement(nativelistpicker)'
JS: [Vue warn]: Error in nextTick: "TypeError: this.nativeView.getTextColor is not a function"

Hi @MCurran16,
Do you have a sample project, where the issue can be reproduced and can be used for debugging?

For me this project - https://github.com/davidcorne/nativescript-listpicker-error is still reproducing this error. I'm trying to make the android sdk changes mentioned above, but can't find where to do that.

I also have the same issue on Android 10.
looking into list-picker.android.js :
tns-core-modules: 6.2.0

    ListPicker.prototype.initNativeView = function () {
        _super.prototype.initNativeView.call(this);
        initializeNativeClasses();
        var nativeView = this.nativeViewProtected;
        //if (sdkVersion() < 29) {
            this._selectorWheelPaint = getSelectorWheelPaint(nativeView);
        //}

comment out the sdkVersion check fix the problem.
I checked the code in this module, if _selectorWheelPaint is not defined, quite some places may be broken.

@cheungcl thank you for your contribution, have a user unable to sign up as the app is crashing, running Android 10. This is the first post I found this morning, 2 hours after you posted it, and your find fixed things my end also, not sure what can of worms it opens though...

running
"tns-core-modules": "~6.2.1",
and
{ "nativescript": "tns-ios": { "version": "6.2.0" }, "tns-android": { "version": "6.3.0-2019-10-22-105535-01" } },

FYI: _v 6.3.0-2019-10-22-105535-01_ for Android was necessary as tns core 6.1 & 6.2 crashes the app if (ironically) using the crashlystics option from nativescript-plugin-firebase

@tsonevn Can we reopen this pls?

this hack is not sufficient for Android 10 ----

//if (sdkVersion() < 29) {
this._selectorWheelPaint = getSelectorWheelPaint(nativeView);
//}

Changed my sdk and build tools:
compileSdkVersion 29
buildToolsVersion "29.0.2"

deleted node modules

rebuilt. Worked

Running NS 6.3

Hello ! I have the same problem with the ListPicker here, however i don't know how to update the compileSdkVersion and the buildToolsVersion on my project ! Someone here can help me out ? Thanks :)

Hello ! I have the same problem with the ListPicker here, however i don't know how to update the compileSdkVersion and the buildToolsVersion on my project ! Someone here can help me out ? Thanks :)

In your app.gradle file you should have something like this....

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 23
targetSdkVersion 29
generatedDensities = []
///MUST BE SAME AS ANDROIDMANIFEST.XML
applicationId "you app info"
versionCode 7
versionName "505357"
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86_64"
}
}

Thanks for the response @cryptodude2000, after that i just remove the node_modules and platforms and do an npm install ?

By the way @cryptodude2000 , my targetSdkVersion needs to be the same as compileSdkVersion ?

Same problem here, no way to make ListPicker working on Android 10 (emulator), with NS 6.3.2, Vue, minSdkVersion 21, targetSdkVersion 29.

android.widget.NumberPicker doesn't have getTextColor, setTextColor methods and mSelectorWheelPaint field.

Same build works on Android 5 (real).

App was working fine until a few days ago when I updated my real device to latest android, just having a <ListPicker in the file would crash the app with the this.nativeView.getTextColor is not a function.

Stuff I did that did not help:
sdkmanager --update

Can confirm it updated build tools to Darwin 29.3

deleted node_modules and rebuilt app, same issue.
iOS is not affected even at latest update of 11.3 and working fine with new Xcode 11.3.1

The question in my mind what happens in the future when my users upgrade say to Android 11 will the app that should be legacy compatible break?

Halp
thanks

Update:
After a lot of fiddling and updates I deleted my node_modules and platforms and ran
tns update
This updated everything including web pack and core modules and tns android, and destroyed my theming because of dark mode BUT the list picker works now on android 29.3 can confirm no crash.
After the update I ran:
tns run android --clean

So I think the steps are follows:
sdkmanager --update
tns update
tns run android --clean

I'm still facing this issue on 6.5

I'm also facing this issue on 6.5, deleting node_modules, updating the SDK and doing clean run doesn't resolve the issue.

replace app.gradle like :

android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 17 generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }

and replace to manifest like :

android:versionCode="7"
android:versionName="505357"

and solved

I'm having the same issue on 6.5 and 6.1.2 ... tried SDK update, node_modules delete, clean run and nothing

I'm having the same issue on 6.5 and 6.1.2 ... tried SDK update, node_modules delete, clean run and nothing

replace app.gradle like :
android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 17 generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }

and replace to manifest like :

android:versionCode="7"
android:versionName="505357"

and solved

I also have the same issue on Android 10.
looking into list-picker.android.js :
tns-core-modules: 6.2.0

    ListPicker.prototype.initNativeView = function () {
        _super.prototype.initNativeView.call(this);
        initializeNativeClasses();
        var nativeView = this.nativeViewProtected;
        //if (sdkVersion() < 29) {
            this._selectorWheelPaint = getSelectorWheelPaint(nativeView);
        //}

comment out the sdkVersion check fix the problem.
I checked the code in this module, if _selectorWheelPaint is not defined, quite some places may be broken.

This was my findings as well. Only affects Android >= 10 (sdk version => 29)

I've also commented out the if statement to get it to work.

Located here
_node_modules\@nativescript\core\ui\list-picker\list-picker.android.js:85_

I'm having the same issue on 6.5 and 6.1.2 ... tried SDK update, node_modules delete, clean run and nothing

replace app.gradle like :
android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 17 generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }

and replace to manifest like :

android:versionCode="7"
android:versionName="505357"

and solved

@pclokcer have you tried this on Android 10? Doubt it fixes it I have the same gradle config except minSdkVersion = 19 as we don't need the earlier sdks

btw android:versionCode="7" & android:versionName="505357" has got nothing to do with this issue as it's only setting the current build version

I'm having the same issue on 6.5 and 6.1.2 ... tried SDK update, node_modules delete, clean run and nothing

replace app.gradle like :
android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 17 generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }
and replace to manifest like :
android:versionCode="7"
android:versionName="505357"
and solved

@pclokcer have you tried this on Android 10? Doubt it fixes it I have the same gradle config except minSdkVersion = 19 as we don't need the earlier sdks

I tried and worked.

I'm having the same issue on 6.5 and 6.1.2 ... tried SDK update, node_modules delete, clean run and nothing

replace app.gradle like :
android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 17 generatedDensities = [] } aaptOptions { additionalParameters "--no-version-vectors" } }

and replace to manifest like :

android:versionCode="7"
android:versionName="505357"

and solved

Worked for me! Thanks!

still an issue. manifest suggestion doesn't seem to work for me. Commenting out the if in list-picker.android.js:85 works for me.

still an issue. manifest suggestion doesn't seem to work for me. Commenting out the if in list-picker.android.js:85 works for me.

        // if (sdkVersion() < 29) {
            this._selectorWheelPaint = getSelectorWheelPaint(nativeView);
        // }

This is the only way ive managed to fix the issue.

Thank you for the continual reports by everyone here and speaking for the TSC, we apologize for the previous core team not addressing this sooner. We have published a fix for this in 6.5.15. Please feel free to ping back if you have any further issue after updating to at least that version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fmmsilva picture fmmsilva  路  3Comments

rLoka picture rLoka  路  3Comments

vtisnado picture vtisnado  路  3Comments

pocesar picture pocesar  路  3Comments

kn9ts picture kn9ts  路  3Comments