The version of SDK you're compiling your code with should be >= the version of support libraries.
For example, if you specify this dependency:
dependencies{compile'com.android.support:appcompat-v7:21.0.+'}
Then you must also usecompileSdkVersion 21(or later).