build.gradle file
apply plugin: \'com.android.application\'
android {
compileSdkVersion 28
defaultConfig {
applicationId \"io.d
I fix this error using 3 methods on YouTube
Set your target sdk version to 27 . Set your compile sdk version to 27 . And app compat version from 28.0.0-alpha3 to 27.1.1 .
If you still want to use sdk version 28
Just replace alpha3 to alpha1 without changing anything else
This worked for me when that happened, I dont know why it doesn't work with 28:
//use this instead
compileSdkVersion 27
buildToolsVersion '27.0.3'
targetSdkVersion 27
dependencies{
//switch to these
implementation 'com.android.support:appcompat-v7:27.0.0-alpha'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.0.0'
}
This worked for me.
Open, res --> values --> styles.xml, here you will find a line like this:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
change it to:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
In otherwords, change DarkActionBar to NoActionBar
I had the same problem. Seems it is a Android Studio bug.
In your styles xml-file change this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
to this:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
Works for me.