Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creating symbolic links in Android SDK folder. After Android-Studio resp. IntelliJ will work with Maven and Gradle.
#!/bin/bash
# Author: Tobias Preuss
# Version: 2018-01-05
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then
echo "Could not find Android SDK. Environment variable ANDROID_HOME is not defined."
exit 1
fi
if [ ! -d "$ANDROID_HOME/build-tools/27.0.3" ] ; then
echo "Could not find build-tools folder 27.0.3. Please download the latest version first."
exit 1
fi
echo "Found ANDROID_HOME set to $ANDROID_HOME"
echo
# For IntelliJ and Android-Studio
ln -s $ANDROID_HOME/platform-tools/adb $ANDROID_HOME/tools/adb
ln -s $ANDROID_HOME/build-tools/27.0.3/aapt $ANDROID_HOME/tools/aapt
ln -s $ANDROID_HOME/build-tools/27.0.3/dx $ANDROID_HOME/tools/dx
ln -s $ANDROID_HOME/build-tools/27.0.3/zipalign $ANDROID_HOME/tools/zipalign
ln -s $ANDROID_HOME/build-tools/27.0.3/lib/dx.jar $ANDROID_HOME/tools/dx.jar
# For Gradle
ln -s $ANDROID_HOME/build-tools/27.0.3/lib/dx.jar $ANDROID_HOME/build-tools/17.0.0/lib/dx.jar
@mbelsky

This comment has been minimized.

Copy link

mbelsky commented Jul 24, 2014

thanks!

@technohowl

This comment has been minimized.

Copy link

technohowl commented Sep 22, 2014

thanks.. it worked like a charm.
Could you explain why the last line for gradle is needed??

@johnjohndoe

This comment has been minimized.

Copy link
Owner Author

johnjohndoe commented Jan 27, 2015

@technohowl In one of the earlier versions of Android Studio an error occurred when dx was not there after Google changed the SDK folder structure. I am not sure if it still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.