XML Rendering errors Android preview N

AndroidXmlAndroid StudioAndroid N-Preview

Android Problem Overview


I have updated android SDK to android preview N after updating, I am getting this xml rendering error. After clicking on details it is showing following stack trace How to avoid this

?

org.jetbrains.android.uipreview.RenderingException: Failed to load the LayoutLib: com/android/layoutlib/bridge/Bridge : Unsupported major.minor version 52.0
at org.jetbrains.android.uipreview.LayoutLibraryLoader.load(LayoutLibraryLoader.java:90)
at org.jetbrains.android.sdk.AndroidTargetData.getLayoutLibrary(AndroidTargetData.java:180)
at com.android.tools.idea.rendering.RenderService.createTask(RenderService.java:166)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:649)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:594)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:589)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Android Solutions


Solution 1 - Android

This is bug in Android Studio. Usually you get error: Unsupported major.minor version 52.0

WORKAROUND: If you have installed Android N, change Android rendering version with older one and the problem will disappear.

SOLUTION: Install Android SDK Tools 25.1.3 (tools) or higher

enter image description here

Solution 2 - Android

NEW SOLUTION:

After Updating Android SDK Tools 25.1.3 It will remove automatically that bug.

Update your SDK Tools.

enter image description here

OLD SOLUTION:

I got same problem after updating sdk with [tag:android-n-preview]

enter image description here

I think there is some bug in API level N, I really appreciate the answer of Ivo Stoyanov but I found another solution that is:

First of all I have change Android Version to use when Rendering layout in IDE with API 23: Android 6.0

enter image description here

Now Error is gone away. I don't know exactly why but Now Its doesn't seems to me.

Thank you :)

Solution 3 - Android

It cause while rendering version is Andorid API 23: AndroidN(Preview). Need to change it [tag:Android-N]. It is a Issue 203683: Unsupported major.minor version 52.0

Solution 4 - Android

I had similar kind of error. I followed the steps mentioned above. I changed the preview version to older version and it worked.

Screenshot for the same

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKrishna MeenaView Question on Stackoverflow
Solution 1 - AndroidIvo StoyanovView Answer on Stackoverflow
Solution 2 - AndroidPratik ButaniView Answer on Stackoverflow
Solution 3 - AndroidpRaNaYView Answer on Stackoverflow
Solution 4 - AndroidTrickyJView Answer on Stackoverflow