Theme Error - how to fix?

你离开我真会死。 提交于 2019-11-27 02:18:12

This is a bug in 28.0.0 and the only fix(workaround) is adding this to your Build.gradle:

configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == "com.android.support") {
                if (!requested.name.startsWith("multidex")) {
                    details.useVersion "27.1.1"
                }
            }
        }
    }

Which somehow, this bypasses the issue and uses 27 support library for that. Otherwise, you may wanna update your Android Studio to canary channel version or using backward support library like 27.1.1 or etc.

This error was occurred in your Rendering Layout which is a part of Studio Not in any files or Library

  1. Try adding "Base" before Theme in styles.xml as show : - "Base.Theme.AppCompat.Light.DarkActionBar"

  2. Please restart Android Studio by selecting the menu option "File" → "Invalidate Caches / Restart"

  3. Workarounds: Try rendering with M preview using AS v1.3 preview OR use FrameLayout for designing and change to android.support.design.widget.CoordinatorLayout while debugging.

I also had the same issue with 28.0.0-alpha1

1.You can either change it to 27 until it's fixed.
OR
2. change <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> to <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
note that Base.
OR
3. in you preview tab change your theme to "Materiar.Light.NoActionBar". some other themes also work but I remember this only.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!