Permission denied when compiling for android on linux

Hey. I’ve recently gotten towards the end of a project i’ve been working on, and I’ve had to download a few more APIs on the android sdk in order to test my game on more phones, however the APIs consume alot of hard drive space and I’ve had to move the sdk folder over to my external hard drive as the entire partition was consumed. Now I’ve reassigned the sdk folder in my project but when I compile for android I get:

Handling Resources…
Found new input file
Generating resource IDs…
/home/dan/JMProjects/DuckyInSpaceAndroid/nbproject/mobile-impl.xml:10: The following error occurred while executing this line:
/media/dan/STORAGE/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/media/dan/STORAGE/android-sdk-linux/tools/ant/build.xml:694: Execute failed:
java.io.IOException: Cannot run program “/media/dan/STORAGE/android-sdk-linux/build-tools/22.0.1/aapt” (in directory “/home/dan/JMProjects/DuckyInSpaceAndroid/mobile”): error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)

I’ve performed:

dan@dan-desktop /media/dan/STORAGE $ sudo chown dan ‘/home/dan/JMProjects/DuckyInSpaceAndroid’ ‘/media/dan/STORAGE/android-sdk-linux’
[sudo] password for dan:
dan@dan-desktop /media/dan/STORAGE $ chmod a=rwx ‘/home/dan/JMProjects/DuckyInSpaceAndroid’ ‘/media/dan/STORAGE/android-sdk-linux’

But the error persists and I have no idea how to solve it. If anyone knows anything I’d very much appreciate anything as I’m almost ready to release my first android game :confused:

Probably the filesystem in /media/dan/STORAGE does not support UNIX permissions. You will need to install Android SDK on a filesystem that does, e.g. under /opt/android-sdk would work fine.

Thanks man

Hello Mr @Momoko_Fan,
How to "install Android SDK on a filesystem that does, e.g. under /opt/android-sdk "?

in Android Studio you have the option to choose where to install the Android SDK.
if it’s already installed just move the SDK where ever you want then go to android studio>settings>Apparence & behaviour >system settings> Android SDK.
if you are using Netbeans then idk it’s out of my experience.