I want to change my compileSdkVersion from 23 to 21.So I have made following changes in the build.gradle but I am getting following error.How can I resolve this?
Below is for Android studio 1. Go to app -> build.gradle -> change "compileSdkVersion 'installed sdk version'"
That's it, problem solved:-)
Note: I think this might be a bug in Android Studio.
If this not work, then:
This error I also getting again and again when I import other's project. So I resolve to change some in Gradle file according to my system.
compileSdkVersion 23
buildToolsVersion "23.0.2"
Which I have already installed in my system.
Just check android home environment variable, it should be : path/../path/sdk and not : path/.../path/sdk/tools example: android home path is : /home/username/android/sdk you should put the following lines to .bashrc file in user home directory:
ANDROID_HOME='/home/username/android/sdk'
PATH="$HOME:$HOME/bin:$ANDROID_HOME/tools:$PATH"
export ANDROID_HOME
export PATH
You are using
compile 'com.android.support:appcompat-v7:23.0.1'
So you have to compile with API 23.
Change your compileSdkVersion
in your build.gradle
file
compileSdkVersion 23
Go to you Android SDK dir and install it properly:
tools/android update sdk
or
tools/android update sdk --no-ui