I am developing a mobile application using Appcelerator and am including some configuration functions using commonJS.
The code that I am running is as follows:
app.js
var well = {};
well.config = require('config');
config.js
var configJson = JSON.parse(Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'config.json'));
exports.getFeed = function(_feed){
return configJson.feeds.sermon[_feed];
};
When I try to run the code, I get the following error:
Location:
[3,0] file:///android_asset/Resources/app.js
Wrapped java.lang.IllegalArgumentException: size must be >= 0 (file:///android_asset/Resources/app.js#3)
Am I doing something wrong to include the module?
you need to turn off fastdev and it will work fine, add this to yout tiapp.xml
<property name="ti.android.fastdev" type="bool">false</property>
<property name="ti.android.compilejs" type="bool">true</property>
I am using 1.7.2 and it is running fine on android