Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering Problems Exception raised during rendering: com.android.ide.common.rendering.api.LayoutlibCallback

I had the same problem after some updates minutes ago, what I did to solve the rendering issue was to change the android version used to render layouts from Android Studio back to "API 23: Android 6.0".

Android studio


java.lang.NoSuchMethodError: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;

Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

Your app must target Android 6.0 (API level 23) to enable this behavior; you do not need to add any additional code.

Just select "API 23: Android 6.0" in Preview Section . enter image description here


I had the same issue when I installed android studio 2.1 on ubuntu 14.04.Even the android robot icon which displays the android version used for rendering layout was only showing API Level 24 version and no other versions.

I had to enable API 23 to be downloaded by navigating to the below path

Tools -> SDK Manager -> Android SDK -> SDK Platforms -> Name.

Check the Android 6.0(Marshwallow) option.This will be downloaded now. Now you will be able to see API Level 23 and by selecting which we can get around this issue.


I had a similar problem with Android Studio 1.5.1 in Windows 10. The preview was not working no matter what version of Android was selected. The stacktrace starts with:

"java.lang.NoSuchMethodError: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;"

When I remove the attribute tools:showIn="@layout/activity_main" from the RelativeLayout the problem resolves for all Android versions except "N". I have Android 2.2, 2.3.3, 5.0.1 and 6.0 enabled

I can't explain why the action resolves the problem though or why it does work for version N.