Results 1 to 2 of 2

Thread: Multiple 'sencha cordova init' executions breaks cordova at runtime

  1. #1

    Default Multiple 'sencha cordova init' executions breaks cordova at runtime

    Hi,

    Been fighting this for 3 days, but believe I've found the cause.

    I have a Sencha Touch app being packaged via Architect, but using Cordova. It also uses several Cordova plugins.

    Suddenly, the plugins were not being loaded at runtime in the application. Inspecting it on the device via the browser showed that the plugin JS files were being packaged correctly -- however, they were all undefined when called by my app.

    I'd been doing everything correctly -- first using 'sencha cordova init', then adding my cordova plugins and finally building in Architect.

    But after an awful lot of digging, it seems that the blame was Sencha Cmd (presumably) adding multiple cordova.js entries to app.json - e.g:

    Code:
    {
       "name": "TestApp",
       "indexHtmlPath": "index.html",
       "url": null,
       "js": [
          {
             "path": "cordova.js",
             "remote": true
          },
          {
             "path": "cordova.js",
             "remote": true
          },
          {
             "path": "cordova.js",
             "remote": true
          },
          {
             "path": "cordova.js",
             "remote": true
          },
          {
             "path": "touch/sencha-touch.js",
             "x-bootstrap": true
          },
          {
             "path": "bootstrap.js",
             "x-bootstrap": true
          },
          {
             "path": "app.js",
             "bundle": true,
             "update": "delta"
    ...etc.

    I'm not sure if these are slipping through when running sencha cordova init multiple times, or if they're left behind and added to when repeatedly removing and adding cordova.

    Burned a few days, but fixed it in the end.

    Chris

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Dallas/Fort Worth
    Posts
    60

    Default Yes, it will...

    I encountered the same issue, which is a problem considering there is no error message related to it. It just doesn't work.

    This is one of the reasons I don't store any of the cordova generated files, platforms, or configurations with my builds. At the start of the build a blow cordova away if it is there, and then add it from scratch. One of the many benefits is that it gets rid of this problem, as well handles plugin updates, changing app name, changing app ID, etc.

    This a detailed description of the process I use: http://www.appfoundation.com/2014/02...-sencha-touch/

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •