Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
614 views
in Technique[技术] by (71.8m points)

android - How to fix "Render problem", "java.lang.NoClassDefFoundError: sun/misc/Cleaner" in IntelliJ IDEA?

I'm following Kotlin Application for Android development by Google on Udacity (code here: https://github.com/udacity/andfun-kotlin-guess-it/ ), and IntelliJ shows a "Render problem" error whenever I try to access Design view of any fragment.xml file and doesnt show any layout elements (just a blank and blue screen). It also shows me this error:

java.lang.NoClassDefFoundError: sun/misc/Cleaner
at libcore.util.NativeAllocationRegistry.registerNativeAllocation_Original(NativeAllocationRegistry.java:130)
at libcore.util.NativeAllocationRegistry_Delegate.registerNativeAllocation(NativeAllocationRegistry_Delegate.java:66)
at libcore.util.NativeAllocationRegistry.registerNativeAllocation(NativeAllocationRegistry.java:119)
at android.os.Binder.<init>(Binder.java:404)
at com.android.internal.view.IInputMethodClient$Stub.<init>(IInputMethodClient.java:18)
at android.view.inputmethod.InputMethodManager$1.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager.<init>(InputMethodManager.java:606)
at android.view.inputmethod.InputMethodManager_Delegate.getInstance(InputMethodManager_Delegate.java:43)
at android.view.inputmethod.InputMethodManager.getInstance(InputMethodManager.java:681)
at com.android.layoutlib.bridge.impl.RenderAction.setUp(RenderAction.java:245)
at com.android.layoutlib.bridge.impl.RenderAction.init(RenderAction.java:133)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.init(RenderSessionImpl.java:163)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:383)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$4(RenderTask.java:640)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: sun.misc.Cleaner PluginClassLoader[org.jetbrains.android, 10.3.3] com.intellij.ide.plugins.cl.PluginClassLoader@25058ce2
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:75)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 22 more

I already tried Invalidating Caches and restarting the application, Clean project, Re-syncing Gradle and changing different settings in Design View, such as API Level and App Theme.

I'm working with Android API 28 and Java version 1.8

I would like to be able to work with Design View tab and make the error go away.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There should be a fix in the new version of Intellij IDEA

See https://youtrack.jetbrains.com/issue/IDEA-219113#focus=streamItem-27-3621529.0-0

Post of Dmitry Jemerov

BR Wolfgang


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...