安卓预览报错 Failed to load AppCompat ActionBar with unknown error
报错信息 :
Render Problem
Failed to load AppCompat ActionBar with unknown error.
Failed to instantiate one or more classes The following classes could not be instantiated: android.support.v7.widget.AppCompatImageView (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.Toolbar (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.AppCompatTextView (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) - android.support.v7.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)
解决方案:
1: try going to the build.gradle(module:app) file in your project, over there, change the following things:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:design:28.0.0-alpha3'
to:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' implementation 'com.android.support:design:28.0.0-alpha1
2:同步之后,Invalid Caches/Restart
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步