Android : Exception raised during rendering: action_bar API 22

I recently updated to API Level 22 i.e. Android Lollipop version: 5.1.1, I see that the Design Layout is unable to display layout.xml files and shows the following error message,

Rendering Problems: Exception raised during rendering: action_bar

This seems like a bug in buildToolsVersion 22 or the Theme issue with the new AppCompact version for 22. may be fixed soon by Google Android Team. Meanwhile, the workaround that I have found is to use the compile version as 21 i.e 5.0 and buildToolsVersion as 21.1.2 in the build. gradle file.

In the Design View, Change the Android Version from API Level 22 to 21 to render the Views on the Android Emulator.

Change API level to 21 to fix action_bar error
Change API level to 21 to fix action_bar error

So the solution is to fall back to the previous Build version until an update is available From Android version 22 ActionBar is deprecated, Google now says that you must instead use Toolbar. Read more about toolbars on the Android Developers site: https://developer.android.com/reference/android/widget/Toolbar.html


This is not an AI-generated article but is demonstrated by a human on an M1 Mac running macOS Sonoma 14.0.

Please support independent contributors like Code2care by donating a coffee.

Buy me a coffee!

Buy Code2care a Coffee!

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!