I am getting this error when I try to run my project. I have installed the latest build tools- 23.0.3 but still the error persists. How do I fix this?
Execut
Set your compileSdkVersion
to 23 in your module's build.gradle
file.
Issue SOLVED by making library and app build.gradle same ... compileSdkVersion and buildToolsVersion.
library build.gradle and
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
.....
.....
}
app build.gradle
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
.....
.....
}
as a quick fix to this question, make sure your compile Sdk verion, your buildtoolsversion, your appcompat, and finally your support library are all running on the same sdk version, for further clarity take a look at the image i just uploaded. Cheers. Follow the red annotations and get rid of that trouble.
I want to add that sometimes android studio loses track of the resources file and can't build on launch. If the above answers are to no avail, try
Build => Rebuild Project
I lost many hours to this when I was a beginner at Android Studio.
Another possible reason
resConfigs "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"
can be source of this issue
I stucked for two days and finally found my solution. I changed the compileSdkVersion to 27 (same with buildToolsVersion)
compileSdkVersion 27
buildToolsVersion '27.0.3'