navigator Objects Are Undefined

14 posts, 1 answers
  1. Troy
    Troy avatar
    12 posts
    Member since:
    Jan 2011

    Posted 28 Jan 2014 Link to this post

    Hi.

    Whenever I use the navigator object, all its properties are undefined e.g the navigator.notifications and navigator.splashscreen objects are undefined. I'm using the same exact code from the AppBuilder demo project.

    document.addEventListener('deviceready', function () {

    // These lines of code don't work
    //navigator.splashscreen.hide();
    //navigator.notification.alert('Both fields are required', function () { }, 'Login failed', 'OK');

    $(document.body).height(window.innerHeight);
    }, false);

    I've checked other threads and everyone says the navigator object was fixed, but it's not working for me. What can I do to get it working?

  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 31 Jan 2014 Link to this post

    Hello Troy,

    We could not reproduce this in our local tests and it doesn't seem like anything we've encountered before, most likely a corrupted project (mixed Cordova version?). Try creating a brand new project and moving your existing project files over to it and see how it goes. Also make sure you have upgraded your Visual Studio extension for AppBuilder to the latest version (you can get it from here)

    Regards,
    Steve
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  3. Josh
    Josh avatar
    61 posts
    Member since:
    Dec 2009

    Posted 04 Feb 2014 Link to this post

    I am having the same problem. After updating to the latest release of AppBuilder, the navigator properties are undefined after deviceready.
    This can be reproduced by creating a new "Kendo UI Mobile" project. Open app.js and add the following line in beginning of the deviceready callback:
    alert(navigator.splashscreen);

    Note that this is only happening in the simulator; I installed to a device and it was all working. Is there a recent change to the simulator that we need to account for?

    I've attached screenshots of the alert and the simulator debug window.
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 07 Feb 2014 Link to this post

    Hello Josh,

    This would start sounding like a template answer, but we could not reproduce this in our local tests, let alone with one of our built-in templates. Can you provide more info about the AppBuilder IDE you're using (Windows Client or VS), the OS version used (whether it is on virtual machine) and everything that you consider relevant.

    P.S. Try changing any of the project properties e.g. turn off the Battery plugin, save your app and run the simulator again.

    Regards,
    Steve
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  5. Josh
    Josh avatar
    61 posts
    Member since:
    Dec 2009

    Posted 07 Feb 2014 in reply to Steve Link to this post

    I've tested with both the VS plugin (2010) and the standalone AppBuilder Windows client. Running Windows 7 Professional SP1 64-bit on a physical machine. The simulator worked nicely before the latest update, even after the change from Icenium to AppBuilder.

    How do I turn off the Battery plugin?

    The cordova version that is created with a new project is 3.2.0, even though the current version is 3.3.0. Do I have to separately update Kendo/cordova?

    Thanks
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Feb 2014 Link to this post

    Hello Josh,

    Thanks for the clarification, I've tested with the same configuration but could not reproduce the problem. Are you able to reproduce this exception on any other machine?

    Turning ON/OFF (enabling/disabling) an integrated plugin is done through the project properties, see Enable and Disable the Integrated Plugins help article.

    The latest official Cordova version is not automatically adopted in Telerik AppBuilder and requires significant efforts and acceptance testing. We usually skip one version of Cordova and update to the next one, so expect an update to 3.4 within a couple of months.

    Regards,
    Steve
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  7. Troy
    Troy avatar
    12 posts
    Member since:
    Jan 2011

    Posted 13 Feb 2014 in reply to Steve Link to this post

    It was the iceproj file. I updated it by creating a new default Kendo UI Mobile project and copied my files over to it. It's working now. Thanks for the reply.
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Feb 2014 Link to this post

    Hi Troy,

    Glad you were able to proceed. My suggestion to turn ON/OFF an integrated plugin should have done automatically what you have done by hand i.e. trigger an update to the .iceproj file, so that it is corrected if it has been corrupted for some reason.

    Regards,
    Steve
    Telerik
    Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
  9. Flavio
    Flavio avatar
    1 posts
    Member since:
    Nov 2014

    Posted 20 May 2015 Link to this post

    I was having the same problem with the navigator.notification.confirm.... I fixed it by turning on the Notification plugin by going into the Project properties and selecting the tab for plugins. see attached screenshot.
  10. Flavien
    Flavien avatar
    3 posts
    Member since:
    Apr 2010

    Posted 05 Oct 2015 Link to this post

    Same issue, I upgraded the AppBuilder to the latest version and nothing works....

    'navigator.splashscreen' is not defined (where it was defined before).

    We seriously have no time for that surprise...​

  11. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 07 Oct 2015 Link to this post

    Hi Flavien,

    Please accept my apology for the inconvenience the latest update of AppBuilder caused in your development process.

    Can you try clearing the Device Simulator cache - you'll find it under the %localappdata%\Telerik\BlackDragon folder. Please remove the entire Cache folder and try running your project in the simulator again.

    If the issue persists, please submit a support ticket with the following information:
    • AppBuilder logs available under the %localappdata%\Telerik\BlackDragon\Logs
      folder
    • A project where the issue can be reproduced

    Also, please let me know if the error messages are only triggered while running the app in the device simulator. I want to make sure they are not thrown when the app is running directly on a device or in a native emulator.

    I am looking forward to your reply and I will do my best to help you resolve these issues in the shortest term possible.

    Regards,
    Tina Stancheva
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  12. Flavien
    Flavien avatar
    3 posts
    Member since:
    Apr 2010

    Posted 07 Oct 2015 in reply to Tina Stancheva Link to this post

    Hi Tina,

    This didn't work but Steve's solution is working ok: Turn on the notification plugin. I don't see how this can be related but it worked.

    Also, you may be able to help me on something quite important to me. I'm trying to access the SQLite file that is used in my application but the AppBuilder Folder structure doesn't work at all, the folders are all empty (see print screen).  
    I changed all the folders in the simultator to test but no luck.

    Any clue?

  13. Tsvetina
    Admin
    Tsvetina avatar
    1873 posts

    Posted 12 Oct 2015 Link to this post

    Hello Flavien,

    The SQLite plugin works only on devices, so its database file isn't available in the Simulator (see Simulator limitations here).

    You can try accessing the SQLite DB file using an app like that one. Or access the DB on the device from your computer using Android Device Monitor, as described in this thread.


    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  14. Ricardo de Assuncao Goncalves
    Ricardo de Assuncao Goncalves avatar
    13 posts
    Member since:
    Feb 2010

    Posted 12 Aug Link to this post

    Hi,

    I fixed this issue about device or navigator is undefined.

    The issue started after I updated to the latest version of Appbuilder yesterday. I fixed this issue by uninstalling the Appbuilder extension and installing it again.

    - In Visual Studio Go to Tools -> Updates and Extensions

    - In the "Installed" tab find the "Telerik Appbuilder" and uninstall it

    - In the "Online" tab find the "Telerik Appbuilder" and Install it

    It should take no more than 5 minutes to complete...

    I looked at the logs folder (%localappdata%\Telerik\BlackDragon\Logs ) and it seems to have an issue when copying the cache folder from one place to another. It cannot find the folder... So don't waste time trying to fix the issue. Just uninstall the extension and install again.

    Hope it helps.

Back to Top