解决Android studio在布局界面右上角显示叹号,布局无法显示问题

目录

问题截图:

问题描述:

解决办法:

参考:


问题截图:

问题描述:

The following classes could not be instantiated:
   - android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache)
   - android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)
   - android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)
 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.  

If this is an unexpected error you can also try to build the project, then manually refresh the layout.  

Exception Details

java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener

解决办法:

这是由于插件版本与SDK版本不符引起的,解决办法是打开app下的build.gradle,修改这几行:

(1)compileSdkVersion 28 改为  compileSdkVersion 27

(2)targetSdkVersion 28    改为  targetSdkVersion 27

(3)implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'改为implementation 'com.android.support:appcompat-v7:27.1.1'

然后点击Sync Now进行同步,同步完成后回到设计界面,预览图可以正常显示。


参考:

https://blog.csdn.net/weixin_42649678/article/details/81182356

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值