Ionic build fails both IOS and Android


#1

All,

I have gone through a marathon session upgrading all of my tools, and now I can’t use Ionic. If anyone has any suggestions to fix the Sanskrit error I get (below), I’d appreciate it.

Thanks,
Bruce

Info

Cordova CLI: 5.1.1
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X Mavericks
Node Version: v0.12.7
Xcode version: Xcode 6.2 Build version 6C131e

BPMacBook:GreatPuzzlePursuit bparr$ ionic build android
Running command: “/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/hooks/after_prepare/icons_and_splashscreens.js” "/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit"
Running command: “/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/hooks/after_prepare/update_platform_config.js” "/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit"
Running command: "/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/cordova/build"
ANDROID_HOME=/Applications/Dev Tools/android-sdk
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Running: /Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/gradlew cdvBuildDebug -b /Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/build.gradle -Dorg.gradle.daemon=true
Exception in thread “main” java.lang.RuntimeException: java.io.FileNotFoundException: /Users/bparr/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1-all.zip.lck (Permission denied)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.io.FileNotFoundException: /Users/bparr/.gradle/wrapper/dists/gradle-2.2.1-all/2m8005s69iu8v0oiejfej094b/gradle-2.2.1-all.zip.lck (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.(RandomAccessFile.java:216)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:49)
… 3 more

/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/bparr/Documents/Ionic Workspace/GreatPuzzlePursuit/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/Users/bparr/.nvm/versions/node/v0.12.7/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)


#2

Try removing /Users/bparr/.gradle/wrapper/dists/ folder, normally the wrapper will download the version it needs on next run.