Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-21781

Running Cordova projects with Cordova plugins fails on iOS simulators

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 4.3.1.CR1
    • 4.3.1.Beta2
    • aerogear-hybrid
    • None
    • devex #4 March 2016
    • 1
    • Hide

      1. Import the provided project (https://github.com/VineetReynolds/cordova-test/tree/master/demo) into JBDS. Or create a new Cordova project, and add the Cordova Device plugin.
      2. Run the project in an iOS simulator.
      3. The application should be deployed on the simulator, but it fail to start and display a "Connecting to device" message. It should instead show a "Device is Ready" message.
      4. Attach the Safari debugger to view the warning messages. Refreshing the page in Safari may be necessary if the error does not appear for the first time.

      Show
      1. Import the provided project ( https://github.com/VineetReynolds/cordova-test/tree/master/demo ) into JBDS. Or create a new Cordova project, and add the Cordova Device plugin. 2. Run the project in an iOS simulator. 3. The application should be deployed on the simulator, but it fail to start and display a "Connecting to device" message. It should instead show a "Device is Ready" message. 4. Attach the Safari debugger to view the warning messages. Refreshing the page in Safari may be necessary if the error does not appear for the first time.

      Cordova projects with Cordova plugins fail to run correctly when started with the iOS simulator through JBDS.

      This appears to be related to JBIDE-21780 where a default config.xml file is created on the fly in the exported XCode project before the project is built and deployed on the simulator.

      Attaching a JavaScript debugger using Safari indicates that Cordova was not initialized successfully. The following messages are reported:

      deviceready has not fired after 5 seconds.
      Channel not fired: onCordovaInfoReady

      which indicates that Cordova failed to initialise.

      As indicated previously, this appears to be related to JBIDE-21780. The config.xml file should be in the location (of the XCode project) as indicated in https://github.com/VineetReynolds/cordova-test/tree/master/demo-ios-working/demo/ios instead of https://github.com/VineetReynolds/cordova-test/tree/master/demo-ios-not-working/demo/ios

      In the working version, config.xml is at demo-ios-working/demo/ios/demo/config.xml only whereas in the non-working one, it is at demo-ios-not-working/demo/ios/demo/config.xml (notice lack of Cordova plugin info) and demo-ios-not-working/demo/ios/www/config.xml.

      A workaround could be obtained by exporting the project and modifying the config.xml, but that basically renders the JBDS tooling moot.

            gercan@redhat.com Gorkem Ercan
            vineet.reynolds_jira Vineet Reynolds (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: