Just 1 week back i was able to run same project on same Mac machine, but after upgrading my system android studio to 3.0 stable release , this Cordova project has stopped building both from console and through android studio.
Please check below is the console run command exception log
Last login: Mon Nov 6 11:47:13 on ttys000
XKL-0439:~ LuckyRana$ sudo cordova create ERL com.xchanging.erla ERL
Password:
Creating a new cordova project.
XKL-0439:~ LuckyRana$ cordova platform add android --save
Error: Current working directory is not a Cordova-based project.
XKL-0439:~ LuckyRana$ cd ERL
XKL-0439:ERL LuckyRana$ sudo cordova platform add android --save
Using cordova-fetch for cordova-android@~6.3.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.xchanging.erla
Name: ERL
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~6.3.0 into config.xml file ...
XKL-0439:ERL LuckyRana$ cordova requirements android
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-27,android-26,android-25,android-24,Google Inc.:Google APIs:24,android-23,Google Inc.:Google APIs:23,android-22,Google Inc.:Google APIs:22,android-21,Google Inc.:Google APIs:21
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
XKL-0439:ERL LuckyRana$ cordova build android --verbose
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
Error: EACCES: permission denied, open '/Users/LuckyRana/ERL/package.json'
XKL-0439:ERL LuckyRana$ sudo cordova run android
ANDROID_HOME=/Users/LuckyRana/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
Error: spawn EACCES
XKL-0439:ERL LuckyRana$
Android Studio Error log:
Could not find com.android.tools.build:gradle:2.3.3. Searched in the following locations: https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.jar Required by: project :CordovaLib Add Google Maven repository and sync project Open File