android studio 报错:Failed to load AppCompat ActionBar with unknown error

版权声明:转载请注明出处 https://blog.csdn.net/weixin_39653948/article/details/83749911

最近开始学Android Studio,但在第一次编写界面的时候就遇到了问题,问题表现为添加Button之后,界面并未显示,并且抛出了错误和警告:
在这里插入图片描述
在Stack Overflow 上找到的解决方案:
在这里插入图片描述
修改res/values/style.xml文件内容,将

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

修改为

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

至此错误解决了,布局显示正常。
在这里插入图片描述

原文地址:https://stackoverflow.com/questions/44449275/failed-to-load-appcompat-actionbar-with-unknown-error-in-android-studio

猜你喜欢

转载自blog.csdn.net/weixin_39653948/article/details/83749911