You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/12/03 02:20:11 UTC

[jira] [Commented] (CB-10125) Cordova build android fails when image files are read-only

    [ https://issues.apache.org/jira/browse/CB-10125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037013#comment-15037013 ] 

ASF GitHub Bot commented on CB-10125:
-------------------------------------

GitHub user jasongin opened a pull request:

    https://github.com/apache/cordova-lib/pull/351

    CB-10125: Android build fails on read-only image files

    Ensure image files are writeable before trying to delete them.
    
    I considered an alternative: ensuring files are writeable after copying them. But that seemed less robust, and other parts of the build are already able to overwrite read-only files due to the use of shell.cp('-f', ...). The only reason this code dealing with image files had a problem was because it deleted the files before re-copying them.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jasongin/cordova-lib CB-10125

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/351.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #351
    
----
commit e5f55415876b819c98189549dbfd231595afdb11
Author: Jason Ginchereau <ja...@microsoft.com>
Date:   2015-12-03T01:09:04Z

    CB-10125: Android build fails on read-only files

----


> Cordova build android fails when image files are read-only
> ----------------------------------------------------------
>
>                 Key: CB-10125
>                 URL: https://issues.apache.org/jira/browse/CB-10125
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaLib
>         Environment: Windows
>            Reporter: Jason Ginchereau
>            Assignee: Jason Ginchereau
>              Labels: Android
>
> 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:
> {noformat}
> 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)
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org