I have noticed that my Android Studio project is suggesting methods and types that are not available for use in my minimum SDK. I am using Android Studio version 1.1.0.
I can see that my minimum SDK version is set correctly in the build.gradle file:
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.pythagoras.sunshine"
minSdkVersion 18
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
...
}
but I have noticed that the "auto-complete" feature in Android Studio still suggests methods that are not available in API 18. When I build the project I do not get any errors about using these newer methods, and since the device I am testing on is using the target API, I do not see any problems in my application.
Is there a setting in Android Studio that can remove auto-complete options from APIs greater than my minimum? Or is there at least a way to get a build error if a method that is too recent is used? I have tried the "Sync Project with Gradle Files" button, but I still did not receive an error upon rebuilding.
Thank you!
android studio compiles your code against compilesdkversion