When I attempt to add the Android platform to my Ionic project, I am greeted with this permission error:
Running command: /Users/USERNAME/Apps/APPNAME/hooks/before_platform_add/init_directories.js /Users/USERNAME/Apps/APPNAME Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.appname.app Name: sortsof Activity: MainActivity Android target: android-24 Subproject Path: CordovaLib Android project created with firstname.lastname@example.org Installing "cordova-plugin-console" for android ANDROID_HOME=/Users/USERNAME/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home Subproject Path: CordovaLib Failed to install 'cordova-plugin-console':Error: spawn EACCES at exports._errnoException (util.js:1026:11) at ChildProcess.spawn (internal/child_process.js:313:11) at Object.exports.spawn (child_process.js:380:9) at exports.spawn (/Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31) at /Users/USERNAME/Apps/APPNAME/platforms/android/cordova/lib/builders/GradleBuilder.js:248:16 at _fulfilled (/Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/q/q.js:834:54) at self.promiseDispatch.done (/Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/q/q.js:863:30) at Promise.promise.promiseDispatch (/Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/q/q.js:796:13) at /Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/q/q.js:857:14 at runSingle (/Users/USERNAME/Apps/APPNAME/platforms/android/cordova/node_modules/q/q.js:137:13) Error: spawn EACCES
I checked the requirements for cordova and see this:
Requirements check results for android: Java JDK: installed 1.8.0 Android SDK: installed true Android target: not installed Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable. Gradle: installed Requirements check results for ios: Apple OS X: installed darwin Xcode: installed 9.0.1 ios-deploy: installed 1.9.1 CocoaPods: not installed CocoaPods was not found. Please install version 1.0.1 or greater from https://cocoapods.org/ Error: Some of requirements check failed
However, when a run echo $ANDROID_HOME from my CLI, it returns this:
So, I am not sure why my SDK is not being found.
I attempted to chown everything in the /hooks/ directory to see if that would solve the permission errors when adding the platform, but the error still persists.
Even when I try to build the Android platform, I still have errors with the /hooks/ directory.
Has anyone else ran into this and have a solution?
Here is my app environment details:
Cordova CLI: 6.4.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 ios-deploy version: 1.9.1 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v6.9.1 Xcode version: Xcode 9.0.1 Build version 9A1004 cordova-plugin-console 1.0.5 "Console" cordova-plugin-device 1.1.6 "Device" cordova-plugin-inappbrowser 1.7.1 "InAppBrowser" cordova-plugin-splashscreen 4.0.3 "Splashscreen" cordova-plugin-statusbar 2.2.1 "StatusBar" cordova-plugin-whitelist 1.3.1 "Whitelist" ionic-plugin-keyboard 2.2.1 "Keyboard"
Thanks in advance for any help or direction.