Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18086] iOS: file.open(Ti.Filesystem.MODE_READ) crashes while opening the file object.

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.5.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.5.0
ReporterKhushbu Agrawal
AssigneeUnknown
Created2014-11-25T10:33:30.000+0000
Updated2018-02-28T19:55:19.000+0000

Description

Description: In the below test case, getFile() method of Filesystem is used for returning the file present at apps Resources folder. The application crashes when tried to open the return file object by using its open() method. This is not a regression as able to reproduce it with 3.4.0 GA and 3.3.0.GA. TestCase: var f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'acceptance.js'); var stream = f.open(Ti.Filesystem.MODE_READ); // crash STEPS TO REPRODUCE: 1. Create the classic iOS titanium application. 2. Replace the code in app.js with the code mentioned above. 3. Add any file named as acceptance.js in its Resources folder. 4. Build the application and launch it on device. EXPECTED RESULTs: 4. The application should launch successfully on device. ACTUAL RESULTS: 4. The application crashes while launching with the below error. Please refer attachment as well.
[ERROR] :  Script Error {
[ERROR] :      column = 20;
[ERROR] :      line = 12;
[ERROR] :      sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/5D52A62E-8359-43BA-8E22-CB95096B69CE/TIMOB-18078.app/app.js";
[ERROR] :      stack = "global code@file:///private/var/mobile/Containers/Bundle/Application/5D52A62E-8359-43BA-8E22-CB95096B69CE/TIMOB-18078.app/app.js:12:20";
[ERROR] :  }

Attachments

FileDateSize
Screen Shot 2014-11-25 at 6.27.30 PM.png2014-11-25T10:33:30.000+000068729

Comments

  1. Khushbu Agrawal 2014-11-27

    The problem seems with passing .js file as argument to getFile() method. The below code works fine. var f = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'acceptance.txt'); var stream = f.open(Ti.Filesystem.MODE_READ); // crash

JSON Source