简体   繁体   中英

Intellij Idea preview not working (Render problem)

I've just started to learn how to create android apps, opened one of the patterns (Empty activity) and now having a strange problem. I can`t see anything on the design tab of the layout.

I'm using Intellij Idea 2019.2, gradle 5.1.1 and androidx library dependencies. I've tried to change this

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"> 

in style.xml. Now I can see components in the tree, but not on the blueprint\\design.

I have this error message:

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)

The app itself works good on the emulated android, but I want to know if there is a way to solve this error.

Update. Components become visible in the tree only after using "Clean Project"

It's a bug in 2019.2 and it has already been reported: https://youtrack.jetbrains.com/issue/IDEA-219113

Also: https://youtrack.jetbrains.com/issue/IDEA-219232 (same issue, different stack trace).

I had the same problem after upgrading so I went back to 2019.1.3 which works. So it seems that the only solution is to downgrade, until an update comes out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM