Ionic build android, Error: spawn EACCES

后端 未结 15 1033
孤城傲影
孤城傲影 2021-01-31 02:44

If I follow this steps to create a new app:

Rubens-MacBook-Pro:~ rlopez$ npm install -g cordova ionic
Rubens-MacBook-Pro:~ rlopez$ ionic start myApp tabs
Rubens-         


        
15条回答
  •  旧巷少年郎
    2021-01-31 03:28

    Running ionic build android --verbose gives the following output:

    /Applications/Android Studio 2.4 
    Preview.app/Contents/gradle/gradle-3.4.1/bin/gradle -p 
    /Users/rlopez/myApp/platforms/android wrapper -b 
    /Users/rlopez/myApp/platforms/android/wrapper.gradle
    
    Error: spawn EACCES
        at exports._errnoException (util.js:1018:11)
        at ChildProcess.spawn (internal/child_process.js:319:11)
        at Object.exports.spawn (child_process.js:378:9)
        at exports.spawn(/Users/rlopez/myApp/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
        at GradleBuilder.runGradleWrapper(/Users/rlopez/myApp/platforms/android/cordova/lib/builders/GradleBuilder.js:78:14)
        at /Users/rlopez/myApp/platforms/android/cordova/lib/builders/GradleBuilder.js:178:21
        at _fulfilled (/Users/rlopez/myApp/platforms/android/cordova/node_modules/q/q.js:854:54)
        at self.promiseDispatch.done (/Users/rlopez/myApp/platforms/android/cordova/node_modules/q/q.js:883:30)
        at Promise.promise.promiseDispatch (/Users/rlopez/myApp/platforms/android/cordova/node_modules/q/q.js:816:13)
        at /Users/rlopez/myApp/platforms/android/cordova/node_modules/q/q.js:570:49
    

    Changing the permissions of /Applications/Android Studio 2.4 Preview.app/Contents/gradle/gradle-3.4.1/bin/gradle solves the problem.

提交回复
热议问题