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

Advertisements
Try Out Code2care Dev Tools:

Advertisements



Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Advertisements


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
πŸŽ‰ We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency