android错误记录

Android studio创建项目后xml文件无法预览并报错如下


Failed to load AppCompat ActionBar with unknown error.


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 Copy stack to clipboard 



根据错误应该是v7的包错误了,百度之后并没有什么特别有效的方法去修改

自己试了半天之后,发现可以正常显示了,首先打开open model settings,选到app ------的dependencies



将图中画圈的修改了,并把默认constraint包删除重新添加,可能会报默认sdk版本过低的错误,在build.gradle中将版本修改之后等项目重新加载完成之后问题应该就解决了。

希望会有更好的方法啦改正这个错误,不知道是不是版本的问题。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值