Im trying to use android dark theme. I install android studio 3.5 preview.
compileSdkVersion 28 targetSdkVersion 28
but still getting this error. Is this dark theme bug or Im doing something wrong?
build.gradle{
dependencies {
// ...
implementation 'com.google.android.material:material:1.1.0-alpha06'
// ...
}}
styles.xml
<style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight">
<item name="android:forceDarkAllowed">true</item>
</style>
project link
You need to up your compiledSdkVersion
to 29, in you app build.gradle:
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
...
}
Then you should be good to go!