Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11338

Plugin javascript resources not copied over to platform for ubuntu

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Ubuntu 15.10

      Current env (though only recently updated in hopes of resolving issue, which was present with prior versions of cordova/nodejs):

      $ cordova -v
      6.1.1

      $ nodejs -v
      v6.2.0

    Description

      Plugin javascript files, including cordova_plugins.js and contents of plugins/ directory, fail to be included in builds for ubuntu. The issue has been found using a host of different plugins (with notional ubuntu support), and will be demonstrated here using the cordova-plugin-device.

      Note: the same plugins do work without issue in Android builds, and the problem may be solved with a simple manual copy, as demonstrated below.

      To replicate failure:
      =================================================
      cordova create plugintest com.example.plugintest plugintest

      cd plugintest/

      cordova plugins add cordova-plugin-device --save

      cordova platform add ubuntu

      cordova prepare ubuntu

      cordova run ubuntu --verbose --debug
      =================================================

      Using chromium to inspect console output and variables (entries preceded by ">" are my input to the console):

      =================================================
      Failed to load resource: net::ERR_FILE_NOT_FOUND 
      file:///tmp/plugintest/platforms/ubuntu/native/prefix/www/cordova_plugins.js
      Received Event: deviceready
      > device
      VM67:1 Uncaught ReferenceError: device is not defined(...)
      =================================================

      To fix:
      =================================================
      cp ./platforms/ubuntu/platform_www/cordova_plugins.js ./platforms/ubuntu/native/prefix/www/

      cp -R ./platforms/ubuntu/platform_www/plugins/ ./platforms/ubuntu/native/prefix/www/

      cordova run ubuntu --verbose --debug --nobuild
      =================================================

      (The --nobuild option is important, otherwise the copied files are destroyed). At this stage, connecting to the console shows no net::ERR_FILE_NOT_FOUND and the "device" from the plugin is present

      =================================================
      adding proxy for Device
      Received Event: deviceready
      > device
      Device {available: true, platform: "Linux", version: "15.10", uuid: "

      {95eabc1234-d601-7563-d35b-abc1234}

      ", ...}
      > device.cordova
      "4.3.2"
      =================================================

      I'm not certain whether the fix would allow building of deb packages, but is sufficient for "cordova run" commands to work correctly.

      I'd appreciate any info concerning anything I may be missing/doing wrong and/or more permanent/automated fixes.

      Thanks,
      PatD

      Attachments

        Activity

          People

            Unassigned Unassigned
            psychogenic Pat Deegan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: