我正在尝试执行
cordova run android --verbose
我明白了
spawn EACCES
作为错误。
所以,我在线搜索并运行
cordova run android --verbose
并将错误标识为:
Running command: /snap/android-studio/76/android-studio/gradle/gradle-5.1.1/bin/gradle -p /home/extensify/Desktop/Code/cordova/platforms/android wrapper -b /home/extensify/Desktop/Code/cordova/platforms/android/wrapper.gradle
spawn EACCES
Error: spawn EACCES
at _errnoException (util.js:1022:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at Object.exports.spawn (child_process.js:502:9)
at Function.spawn (/home/extensify/Desktop/Code/cordova/node_modules/cross-spawn/index.js:12:24)
at exports.spawn (/home/extensify/Desktop/Code/cordova/node_modules/cordova-common/src/superspawn.js:90:28)
at ProjectBuilder.runGradleWrapper (/home/extensify/Desktop/Code/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js:70:20)
at /home/extensify/Desktop/Code/cordova/platforms/android/cordova/lib/builders/ProjectBuilder.js:209:29
at _fulfilled (/home/extensify/Desktop/Code/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done (/home/extensify/Desktop/Code/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch (/home/extensify/Desktop/Code/cordova/node_modules/q/q.js:816:13)
通过更改文件/snap/android-studio/76/android-studio/gradle/gradle-5.1.1/bin/gradle
的权限,我可以阅读其中的内容
要解决此问题,我尝试运行
sudo chmod +x /snap/android-studio/76/android-studio/gradle/gradle-5.1.1/bin/gradle
并不断得到
chmod: changing permissions of '/snap/android-studio/76/android-studio/gradle/gradle-5.1.1/bin/gradle': Read-only file system
我读到的可以通过重新安装硬盘来解决,我再次尝试使用几个命令,但无法解决。
接下来我可以尝试什么?
答案 0 :(得分:0)
此答案适用于Ubuntu 18.04
我遇到了同样的问题,这是我如何解决它们:
/usr/local/
,为共享用户为/opt/
提取sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
kvm
android-studio/bin/
目录,然后执行./studio.sh
$PATH
:
/opt/android-studio/gradle/gradle-{version}/bin
或/usr/local/android-studio/gradle/gradle-{version}/bin
/opt/android-studio/jre/bin
或/usr/local/android-studio/jre/bin
/home/{name}/Android/Sdk/platform-tools
/home/{name}/Android/Sdk/tools/bin
/home/{name}/Android/Sdk/emulator/bin
android list avd
列出虚拟设备emulator -avd {deviceName}
cordova run android
,它应该可以工作推荐
Tools > Create Desktop Entry...
,以便您可以轻松启动Android Studio