我知道这个问题已被问过很多次了,但到目前为止给出的答案并没有解决我的问题。
当尝试将应用程序构建到Android设备/ -imimulator / -package时,Appcelerator会出现此错误:
[ERROR]应用程序安装程序异常进程终止。流程退出值为1
appc logout -D
/ appc login
appc setup
npm install alloy -g
和 npm install appc-cli-titanium
<tool-api-level>17< /tool-api-level>
添加到tiapp.xml <uses-sdk android:maxSdkVersion="26" android:minSdkVersion="16" android:targetSdkVersion="25"/>
控制台处于跟踪模式,这就是我得到的:
[INFO] : ----- MVC GENERATION -----
[INFO] : [app.tss] global style processing...
[INFO] : [global style] writing to cache...
[INFO] : [index.xml] view processing...
[INFO] : style: "index.tss"
[INFO] : view: "index.xml"
[INFO] : controller: "index.js"
[INFO] : created: "Resources/android/alloy/controllers/index.js"
[DEBUG] : map: "build/map/Resources/android/alloy/controllers/index.js.map"
[INFO] : created: "Resources/android/alloy/styles/index.js"
[INFO] :
[INFO] : [app.js] Titanium entry point processing...
[DEBUG] : /Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-core/lib/transformation/file/index.js:590
[DEBUG] : throw err;
[DEBUG] : ^
[DEBUG] : TypeError: unknown: Property property of MemberExpression expected node to be of a type ["Identifier"] but instead got "BooleanLiteral"
[DEBUG] : at validate (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-types/lib/definitions/index.js:109:13)
[DEBUG] : at Object.validate (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-types/lib/definitions/core.js:412:50)
[DEBUG] : at Object.validate (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-types/lib/index.js:505:9)
[DEBUG] : at NodePath._replaceWith (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/replacement.js:176:7)
[DEBUG] : at NodePath.replaceWith (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/replacement.js:160:8)
[DEBUG] : at PluginPass.Identifier (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/Alloy/commands/compile/ast/optimizer-plugin.js:65:11)
[DEBUG] : at newFn (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/visitors.js:276:21)
[DEBUG] : at NodePath._call (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:76:18)
[DEBUG] : at NodePath.call (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:48:17)
[DEBUG] : at NodePath.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:105:12)
[DEBUG] : at TraversalContext.visitQueue (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:150:16)
[DEBUG] : at TraversalContext.visitSingle (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:108:19)
[DEBUG] : at TraversalContext.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:192:19)
[DEBUG] : at Function.traverse.node (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:114:17)
[DEBUG] : at NodePath.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:115:19)
[DEBUG] : at TraversalContext.visitQueue (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:150:16)
[DEBUG] : at TraversalContext.visitSingle (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:108:19)
[DEBUG] : at TraversalContext.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:192:19)
[DEBUG] : at Function.traverse.node (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:114:17)
[DEBUG] : at NodePath.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:115:19)
[DEBUG] : at TraversalContext.visitQueue (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:150:16)
[DEBUG] : at TraversalContext.visitSingle (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:108:19)
[DEBUG] : at TraversalContext.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:192:19)
[DEBUG] : at Function.traverse.node (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:114:17)
[DEBUG] : at NodePath.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:115:19)
[DEBUG] : at TraversalContext.visitQueue (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:150:16)
[DEBUG] : at TraversalContext.visitMultiple (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:103:17)
[DEBUG] : at TraversalContext.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:190:19)
[DEBUG] : at Function.traverse.node (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:114:17)
[DEBUG] : at NodePath.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/path/context.js:115:19)
[DEBUG] : at TraversalContext.visitQueue (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:150:16)
[DEBUG] : at TraversalContext.visitSingle (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:108:19)
[DEBUG] : at TraversalContext.visit (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/context.js:192:19)
[DEBUG] : at Function.traverse.node (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:114:17)
[DEBUG] : at traverse (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-traverse/lib/index.js:79:12)
[DEBUG] : at File.transform (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-core/lib/transformation/file/index.js:548:35)
[DEBUG] : at /Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-core/lib/transformation/pipeline.js:73:19
[DEBUG] : at File.wrap (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-core/lib/transformation/file/index.js:564:16)
[DEBUG] : at Pipeline.transformFromAst (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/node_modules/babel-core/lib/transformation/pipeline.js:70:17)
[DEBUG] : at Object.exports.generateCodeAndSourceMap (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/Alloy/commands/compile/sourceMapper.js:112:27)
[DEBUG] : at generateAppJs (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/Alloy/commands/compile/index.js:554:16)
[DEBUG] : at module.exports (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/Alloy/commands/compile/index.js:480:2)
[DEBUG] : at Object.<anonymous> (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/Alloy/alloy.js:112:46)
[DEBUG] : at Module._compile (module.js:570:32)
[DEBUG] : at Object.Module._extensions..js (module.js:579:10)
[DEBUG] : at Module.load (module.js:487:32)
[DEBUG] : at tryModuleLoad (module.js:446:12)
[DEBUG] : at Function.Module._load (module.js:438:3)
[DEBUG] : at Module.require (module.js:497:17)
[DEBUG] : at require (internal/module.js:20:19)
[DEBUG] : at Object.<anonymous> (/Users/bas/.appcelerator/install/6.3.0/package/node_modules/alloy/bin/alloy:3:1)
[DEBUG] : at Module._compile (module.js:570:32)
[DEBUG] : at Object.Module._extensions..js (module.js:579:10)
[DEBUG] : at Module.load (module.js:487:32)
[DEBUG] : at tryModuleLoad (module.js:446:12)
[DEBUG] : at Function.Module._load (module.js:438:3)
[DEBUG] : at Module.runMain (module.js:604:10)
[DEBUG] : at run (bootstrap_node.js:390:7)
[DEBUG] : at startup (bootstrap_node.js:150:9)
[DEBUG] : at bootstrap_node.js:505:3
[ERROR] : Alloy compiler failed
[ERROR] Application Installer abnormal process termination. Process exit value was 1
答案 0 :(得分:4)
你可以通过恢复到cli 6.2.2来解决这个问题 6.3替换旧版本的文件缩小以允许ES6语法,但这显然会导致您的问题。
执行&#34; appc使用6.2.2&#34;在命令行中(当然没有引号)并确保在粘贴的行之前看到日志中使用的Alloy 1.9.x.