Titanium 所需模块出错,参数大小必须为>;=0
我正在使用Appcelerator开发一个移动应用程序,并使用commonJS包含一些配置函数 我正在运行的代码如下所示: app.jsTitanium 所需模块出错,参数大小必须为>;=0,titanium,appcelerator,appcelerator-mobile,commonjs,Titanium,Appcelerator,Appcelerator Mobile,Commonjs,我正在使用Appcelerator开发一个移动应用程序,并使用commonJS包含一些配置函数 我正在运行的代码如下所示: app.js var well = {}; well.config = require('config'); config.js var configJson = JSON.parse(Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'config.json')); exports.getFeed
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)
我是否在包含模块时出错?您需要关闭fastdev,它会正常工作,请将此添加到yout tiapp.xml
<property name="ti.android.fastdev" type="bool">false</property>
<property name="ti.android.compilejs" type="bool">true</property>
false
真的
我使用的是1.7.2,它在android上运行良好您需要关闭fastdev,它将正常工作,请将其添加到yout tiapp.xml
<property name="ti.android.fastdev" type="bool">false</property>
<property name="ti.android.compilejs" type="bool">true</property>
false
真的
我使用的是1.7.2,它在android上运行良好是否需要将其添加到xml的android部分,或者正好添加到xml的主要ti:app区域下?是否需要将其添加到xml的android部分,或者正好添加到xml的主要ti:app区域下?