1
我正在开发一个使用Appcelerator的移动应用程序,并且包含一些使用commonJS的配置功能。所需模块出错,参数大小必须> = 0
,我运行的代码如下:
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];
};
当我尝试运行的代码,我得到以下错误:
Location:
[3,0] file:///android_asset/Resources/app.js
Wrapped java.lang.IllegalArgumentException: size must be >= 0 (file:///android_asset/Resources/app.js#3)
我是否做错了包含模块?
运行良好,这是否需要被添加到xml的android部分,还是仅仅在xml的主要ti:app区域下面? –
主要会做得很好! –