[AC-2264] file not found in assets folder
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2014-02-20T06:59:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy |
Labels | android |
Reporter | Jude Addo |
Assignee | Ritu Agrawal |
Created | 2014-02-20T05:14:47.000+0000 |
Updated | 2016-03-08T07:41:16.000+0000 |
Description
I tried to load a json file which i have stored in \app\assets\data.
i tried reading it from the controller like this
var fileName = '/data/data.json';
but i get this error "/data/data/com.isasgh.icgc.lwd/app_appdata/data/data.json: open failed: ENOENT (No such file or directory)"
this is full code var fileName = '/data/data.json'; var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, fileName); var json, object_name, id; var preParseData = (file.read().text); var response = JSON.parse(preParseData); var idd = response.object_name[0].id; alert(idd);
Duplicate of TC-3797.