Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6164] Tooling: building an Android project causes IOError 13 when resource files are read-only (Windows)

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-19T01:18:04.000+0000
Affected Version/sRelease 1.7.2
Fix Version/s2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0
ComponentsTooling
Labelsandroidbuild, cb-verified, qe-closed-3.2.0, triage
ReporterShawn Lipscomb
AssigneeAllen Yeung
Created2011-09-27T08:38:37.000+0000
Updated2013-12-19T14:08:58.000+0000

Description

When files in the Resources directory (and below) have the read-only attribute set (as many source-control programs do), the build process regularly generates errors like this in the Application Installer console window:
[ERROR] IOError: [Errno 13] Permission denied: 'C:\\Titanium\\Workspace\\Proj1\\build\\android\\bin\\assets\\Resources\\tiapp.xml'
It happens on many files, especially image files. (with image files, it seems that every other build generates this error.) Cause: Running Titanium Studio under Windows, the build process calls the copy function in shutil.py (under plugins\com.appcelerator.titanium.python.win32_1.0.0.1312318466\python\Lib\shutil.py) to copy files into the build directory. That copy function calls copymode after copying the file. copymode (in the same file) calls os.chmod which, under Windows, can only copy the read-only attribute of a file. This is what's causing the problem. Since there's no need for the read-only attribute on any file in the build directory, this should be removed.

Comments

  1. Allen Yeung 2012-03-20

    I was unable to reproduce this issue on windows. I have changed some of the images in my resources directory to read-only, and I don't run into this issue. Could you please provide a sample project and some reproduction steps for this issue? Thanks, Allen
  2. Shawn Lipscomb 2012-06-05

    Still happens to me all the time, now with Ti Studio 2.0.3.201205312012 and mobile SDK 2.1.0.v.... I can reproduce it easily by making tiapp.xml read-only and doing a clean build, followed by another build. Once a read-only file gets into the build directory, when that file is then changed, the next build fails with the IOError 13.
  3. Neeraj Gupta 2012-06-05

    Reopening this ticket for further analysis.
  4. Mark Lutz 2012-10-05

    I am currently having this problem Windows Server 2008 R2 Titanium build: 2.1.2.201208301612 Titanium SDK: 2.1.3.GA Connected to a TFS 2010 Server /build/ and /build/.* are in the .tpignore file I get the read only on the tiapp.xml in the build directory I uncheck the readonly flag on the tiapp.xml file in both the build directory as well as the Project directory Then I get the read error on the .fastdev.lock file Then I uncheck the readonly flag on that in both the build and project directories and finally it will build and launch.
  5. Jon Barnhart 2013-03-12

    I am currently having this problem on Mac OS X 10.8. Titanium Studio 3.0.2.201302191606 Titanium SDK 3.0.2.GA
  6. Shawn Lipscomb 2013-07-23

    10 watchers, priority set to high, but still no action. This is still a problem in SDK 3.1.1.GA
  7. Ingo Muschenetz 2013-10-14

    [~ayeung], might this be fixed with the new build process?
  8. Allen Yeung 2013-10-14

    It could be... it's labeled as androidbuild, so we'll be going through to verify if it's still an issue.
  9. Allen Yeung 2013-10-14

    Oh, I guess Chris just added it... so anyways, we'll check it out.
  10. Allen Yeung 2013-10-19

    PR: https://github.com/appcelerator/titanium_mobile/pull/4781
  11. Samuel Dowse 2013-12-18

    Verified fixed on: Windows 7, 8 and 8.1 Windows Server 2008 Titanium Studio, build: 3.2.0.201312091613 Titanium SDK, build: 3.2.0.v20131218114845 CLI: 3.2.0-cr3 Alloy: 1.3.0-cr Created a default application for Android in a local workspace and made all files inside the Resources folder read-only. Also made the tiapp.xml file read-only. Also created a default application for Android on a network workspace from Windows 7 to Windows Server 2008. Both projects built and installed successfully to device and emulator. Closing.
  12. Shawn Lipscomb 2013-12-19

    To fully test, you have to build a project twice. The first time drops the files in the Build directory. The second time tries to overwrite those files.

JSON Source