Ionic build android, Error: spawn EACCES

后端 未结 15 986
孤城傲影
孤城傲影 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:13

    Only for OSX --- Go to Applications Folder from finder and Simply rename Android Studio App Package name by removing space between.

    Before : Android Studio After: AndroidStudio

    There is no issue of permissions by default just the space was the problem.

    Cheers !

    0 讨论(0)
  • 2021-01-31 03:17

    run the cordova command with --verbose option. Do not prefix the command with ionic cordova. This will tell you where the access problem is. For me it was a problem where gradlew was installed on my system without execution privileges. Once i add execution ability to gradlew, the eaccess error went away.

    0 讨论(0)
  • 2021-01-31 03:18

    it is a permission issue chmod cmd will help you

    step 1: use cmd sudo cordova run android --verbose

    step 2: find below line it may vary on your install location:

    /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
    

    step 3: run cmd with your location

    sudo chmod -R 777 /Applications/Android\ Studio.app
    

    step 4: run cmd cordova build android

    0 讨论(0)
  • 2021-01-31 03:19

    I got a great solution.

    This is the problem of new version of Android Studio. So downgrade this version to 2.3.3 https://developer.android.com/studio/archive.html

    0 讨论(0)
  • I had the same issue, I solved it by running the command below in the app folder:

    ionic hooks add
    
    0 讨论(0)
  • 2021-01-31 03:21

    I was able to fix by running the following command in Terminal

    sudo chmod 755 "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle"
    

    After running that I was able to run this command successfully

    ionic cordova build android --release 
    
    0 讨论(0)
提交回复
热议问题