Error on Nativescript Custom dialogue.

Thread is closed for posting
2 posts, 0 answers
  1. soumen
    soumen avatar
    6 posts
    Member since:
    Dec 2016

    Posted 15 Sep 2017 Link to this post

    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

  2. Nikolay Tsonev
    Admin
    Nikolay Tsonev avatar
    340 posts

    Posted 18 Sep 2017 Link to this post

    Hello Soumen,

    I reviewed the attached tutorial, however, was unable to reproduce the below mentioned 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.
Back to Top