93

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)
N J
  • 27,217
  • 13
  • 76
  • 96
Krishna Meena
  • 5,693
  • 5
  • 32
  • 44

4 Answers4

229

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

Ivo Stoyanov
  • 16,256
  • 8
  • 62
  • 65
10

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

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 :)

Community
  • 1
  • 1
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
5

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

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
1

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

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
TrickyJ
  • 61
  • 2