當試圖運行Android的手機上的一個項目,Appcelerator的給出了一個錯誤:Appcelerator的[錯誤]:無法解析...控制器/圖片 - list.js.js
[INFO] : Alloy compiled in 6.57967s
[INFO] : Alloy compiler completed successfully
[INFO] : JavaScript files need to be encrypted
[INFO] : Processing JavaScript files
[ERROR] : Failed to parse /Users/bas/Documents/Appcelerator_Studio_Workspace/Whatever-App-master/Resources/android/alloy/controllers/picture-list.js.js
[ERROR] : Invalid left-hand side in assignment expression (21:4)
的蠢事是Appcelerator自己創建的文件:
[INFO] : [picture-list.js.xml] view processing...
[INFO] : style: "picture-list.js.tss"
[INFO] : view: "picture-list.js.xml"
[INFO] : created: "Resources/android/alloy/controllers/picture-list.js.js"
[INFO] : created: "Resources/android/alloy/styles/picture-list.js.js"
...那麼爲什麼要製作一個文件,然後再抱怨呢?
該應用程序現在沒有運行,編譯後停止。
畫面list.js:
function __processArg(obj, key) {
var arg = null;
if (obj) {
arg = obj[key] || null;
delete obj[key];
}
return arg;
}
function Controller() {
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = "complaints/picture-list";
this.args = arguments[0] || {};
if (arguments[0]) {
__processArg(arguments[0], "__parentSymbol");
__processArg(arguments[0], "$model");
__processArg(arguments[0], "__itemTemplate");
}
var $ = this;
var exports = {};
$.__views.pictures = Ti.UI.createTableViewSection({ // line 21
id: "pictures"
});
$.__views.pictures && $.addTopLevelView($.__views.pictures);
exports.destroy = function() {};
_.extend($, $.__views);
_.extend($, exports);
}
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
module.exports = Controller;
畫面list.js.js:
function __processArg(obj, key) {
var arg = null;
if (obj) {
arg = obj[key] || null;
delete obj[key];
}
return arg;
}
function Controller() {
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = "picture-list.js";
this.args = arguments[0] || {};
if (arguments[0]) {
__processArg(arguments[0], "__parentSymbol");
__processArg(arguments[0], "$model");
__processArg(arguments[0], "__itemTemplate");
}
var $ = this;
var exports = {};
$.__views.picture - list.js = Ti.UI.createView({ // line 21
id: "picture-list.js"
});
$.__views.picture - list.js && $.addTopLevelView($.__views.picture - list.js);
exports.destroy = function() {};
_.extend($, $.__views);
_.extend($, exports);
}
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
module.exports = Controller;
我添加了代碼,但是在第21行我沒有看到什麼奇怪的東西? – xs2bas
@ xs2bas我更新了答案。如果你在代碼中看起來更多一點,你可以很容易地發現它。 –
將所有'picture-list'-stuff重命名爲picture_list都有訣竅。 – xs2bas