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. maybe 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 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 Android Developers site: https://developer.android.com/reference/android/widget/Toolbar.html