Pages

Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, November 23, 2017

cordova run android Error: spawn EACCES (MacOS)

When executing "cordova run android", I got error message: "Error: spawn EACCES". By using --verbose:
$ cordova run android --verbose ... Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle" -p /Users/myuserid/cordova/myApp/platforms/android wrapper -b /Users/myuserid/cordova/myApp/platforms/android/wrapper.gradle Error: spawn EACCES

When I checked the access permission of /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle, I found that there is no execute permission. The solution for the error is just by modifying the access permission:
$ sudo chmod +x /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle

That's all :)

Friday, December 19, 2014

Android Studio was unable to find a valid JVM

I obtained the following message when opening Android Studio 1.0.1 on Mac OSX Yosemite:
Android Studio was unable to find a valid JVM
Among some workarounds for the problem that I found in this Stackoverflow thread, I think the simplest one is by creating a small bash script that export the environment variable for the JVM and launch the Android Studio. For example, in my machine the JVM is located at /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk, so the script looks like this:
#!/bin/bash export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk open /Applications/Android\ Studio.app


That's all :)