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

Cordova build android fails when image files are read-only

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-lib
    • Windows

    Description

      1. Create a new Cordova project.
      2. Add the project to a source control system (such as TFS) that adds the read-only attribute to the files.
      3. Build the project for Android.
      4. Build again.

      RESULT: The second build fails because it can't overwrite an image file under platforms/android, because the file has the read-only attribute copied from the source file during the first build.

      Here's output from a verbose build showing the stack trace:

      Error: EPERM, operation not permitted 'D:\Projects\Test167867\platforms\android\res\drawable-land-hdpi\screen.png'
          at Error (native)
          at Object.fs.unlinkSync (fs.js:883:18)
          at android_parser.deleteDefaultResource (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:80:20)
          at android_parser.handleSplashes (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:112:14)
          at android_parser.update_from_config (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:213:10)
          at android_parser.update_project (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\metadata\android_parser.js:349:14)
          at PlatformApiPoly.prepare (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\PlatformApiPoly.js:212:25)
          at C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:100:32
          at _fulfilled (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
          at self.promiseDispatch.done (C:\Users\jasongin\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
      

      This seems to only be a problem with image files. While the read-only attribute is also copied on HTML files & scripts, the build is able to copy over them without a problem.

      Attachments

        Activity

          People

            jasongin Jason Ginchereau
            jasongin Jason Ginchereau
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: