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區域下面? –
主要會做得很好! –