我在Windows上与Apache Cordova合作过很多但由于某种原因我无法让这个项目在Ubuntu上运行。
我已正确设置Android SDK,因此adb
和android
都从终端运行。
这是我在android上运行项目时得到的输出。
josh@josh-ubuntu:~/Projects/hello$ cordova run android
Running command: /home/josh/Projects/hello/platforms/android/cordova/run
/home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error: EACCES, permission denied '/usr/local/bin/android-sdk-linux/tools/lib/build.template'
at Object.fs.openSync (fs.js:438:18)
at Object.fs.readFileSync (fs.js:289:15)
at /home/josh/Projects/hello/platforms/android/cordova/lib/build.js:120:40
at _fulfilled (/home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:574:44
at flush (/home/josh/Projects/hello/platforms/android/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
Error: /home/josh/Projects/hello/platforms/android/cordova/run: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
我的文件权限可能有问题吗?
答案 0 :(得分:0)
日志说这是一个权限问题!
尝试执行
sudo cordova运行android
如果它允许你,那么肯定这是一个许可问题!