NativeScript / nativescript-datetimepicker

Plugin with date and time picking fields
Apache License 2.0
27 stars 26 forks source link

Exception on Android with NS7 and v2.0.4 #77

Closed mreall closed 3 years ago

mreall commented 3 years ago

If the demo apps cannot help and there is no issue for your problem, tell us about it

I get the following exception when trying to load the date picker on Android using NS7 and @nativescript/datetimepicker@2.0.3 (and @2.0.4). The picker never displays.

I have a TextField with an tap listener getDate that calls:

DateTimePicker.pickDate({
  maxDate: new Date(),
  date: startingDate,
})
.then((res) => {...});

Exception

Exception has occurred: Error
_createNativeDatePicker(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:51160:22)
    at (/Users/user/websites/test/picker/platforms/android/app/src/main/assets/app/vendor.js:51117:48)
    at pickDate(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:51108:22)
    at getDate(file:///data/user/0/org.nativescript.picker/files/app/bundle.js:77:83)
    at invokeWithErrorHandling(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:64687:26)
    at invoker(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:65392:14)
    at _executeCallback(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:31043:23)
    at TapAndDoubleTapGestureListenerImpl._handleSingleTap(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30711:11)
    at TapAndDoubleTapGestureListenerImpl.onSingleTapUp(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30670:12)
    at androidOnTouchEvent(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:30961:35)
    at (/Users/user/websites/test/picker/platforms/android/app/src/main/assets/app/vendor.js:23144:18)
    at handleGestureTouch(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:23143:12)
    at TouchListenerImpl.onTouch(file:///data/user/0/org.nativescript.picker/files/app/vendor.js:22817:13)

This works fine on NS7 iOS14

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I created a new project (ns create picker --vue) and added a TextField with an onTap handler called getDate. Run the debugger on the app, monitor All Exceptions, then tap the TextField. You should see the error. I've attached the minimal test project.

NathanaelA commented 3 years ago

Please use the https://github.com/NativeScript/plugins/ repo for issue with any @nativescript plugins.