This is a migrated thread and some comments may be shown as answers.

Error on Nativescript Custom dialogue.

1 Answer 78 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
soumen
Top achievements
Rank 1
soumen asked on 15 Sep 2017, 01:12 PM

In my app I am implementing custom dialog. I followed the tutorial here(https://www.thepolyglotdeveloper.com/2017/01/using-modal-dialogs-nativescript-angular-mobile-application/). As per the tutorial, while calling "this.modal.showModal" function I am getting a functioning modal box, however there is a error on my console. (See Below): Please let me know what the problem could be.

FYI: The error is occurring on android physical device. 

JS: ERROR Error: Uncaught (in promise): Error: java.lang.NullPointerException: A
ttempt to invoke virtual method 'android.os.Looper android.content.Context.getMa
inLooper()' on a null object reference
JS: ERROR Error: Uncaught (in promise): Error: java.lang.NullPointerException: A
ttempt to invoke virtual method 'android.os.Looper android.content.Context.getMainLooper()' on a null object reference

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsonev
Telerik team
answered on 18 Sep 2017, 11:45 AM
Hello Soumen,

I reviewed the attached tutorial, however, was unable to reproduce the error. The only change that you should make in the code, which is shown in it, is to change template directive with ng-template while using the ListView. For your convenience, I am attaching a sample project. You could review it and verify whether I am missing something.

Bear in mind that I tested this scenario with latest NativeScript version 3.2.1. If you are using some older version I would recommend upgrading to the new one.

Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
General Discussion
Asked by
soumen
Top achievements
Rank 1
Answers by
Nikolay Tsonev
Telerik team
Share this question
or