Android build error: EACCESS - Mac OS


#1

My project is working for iOS. I can compile and distribute it without problem. It was working also on android devices but, since last changes I had to compile it again and now Im gatting a EACCESS error. I tried everthing that I found on internet since change the dir owner of some directories to remove all android studio and install again from scratch.

Error log:

[15:55:39] copy started …
[15:55:39] transpile started …
[15:55:44] transpile finished in 5.23 s
[15:55:44] preprocess started …
[15:55:44] deeplinks started …
[15:55:45] deeplinks finished in 155 ms
[15:55:45] preprocess finished in 156 ms
[15:55:45] webpack started …
[15:55:52] copy finished in 13.21 s
[15:56:06] webpack finished in 21.15 s
[15:56:06] sass started …
[15:56:08] sass finished in 2.47 s
[15:56:08] postprocess started …
[15:56:08] postprocess finished in 9 ms
[15:56:08] lint started …
[15:56:08] build dev finished in 29.16 s

cordova build android --release
15:56:16] lint finished in 7.37 s
:heavy_multiplication_x: Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] An error occurred while running cordova build android --release (exit code 1):

    ANDROID_HOME=/Users/myuser/Library/Android/sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home
    Subproject Path: CordovaLib
    Error: spawn EACCES


package list ............. List your cloud builds

ionic info command gives me:

global packages:

@ionic/cli-plugin-proxy : 1.3.1
@ionic/cli-utils        : 1.4.0
Cordova CLI             : 7.0.1
Ionic CLI               : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 3.3.0

System:

Node       : v6.9.4
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.1
ios-sim    : 5.0.13
npm        : 3.10.10

#2
  • What is the exact command you are executing?
  • Run it again with --verbose added at the end.
  • Run the same command without the ionic in the beginning but add --debug at the end.

#3

Hey Sujan12,

Sorry, the command is a build:

ionic cordova build android --verbose

I dont know if there is a better way, but I change the access of the platforms/android and its working now.

sudo chmod -R a+rwx /users/myuser/documents/source/myapp/platforms/android

Thanks!


#4

Probably will come back, but these things are difficult to fix once sudo was used. Great you can keep working.


#5

Yes! You are right! I had a mistake when installed my environment using sudo. Now I know about that and will try to reinstall in a correct way.
Thanks again!


#6

Anybody coming across this thread: please please please do not emulate the post marked as the "solution"recommending chmod -R. It is vastly overbroad and dangerous. Find the specific file or directory causing problems and use chown to give ownership back to the user who is trying to build.

Alternatively, remove and readd the problematic platform.


#7

Hi! I marked your post as a solution.

Just to help others: I also tried to add again the platform what doesnt worked!


#8

If you remove the platform, completely clean out its directory (here sudo may be required if there are files your user doesn’t own in there), and then readd the platform as your build user, sort of by definition your user must own everything added under platforms/android at that point.