我使用Android Studio版本2.2.3
。我制作了只包含50个按钮的简单xml代码。但是当我尝试查看预览时,我遇到了渲染问题。但是,它通常在我的智能手机设备中运行。我改变了API,主题,但它们没有用。
我下载了Android SDK:Android 4.2, 4.3, 5.0, 5.1, 6.0, 7.0, 7.1.1
这是错误信息: -
java.lang.NullPointerException
at android.graphics.Paint_Delegate.reset(Paint_Delegate.java:1238)
at android.graphics.Paint_Delegate.<init>(Paint_Delegate.java:1179)
at android.graphics.Paint_Delegate.nInit(Paint_Delegate.java:675)
at android.graphics.Paint.nInit(Paint.java)
at android.graphics.Paint.<init>(Paint.java:457)
at android.graphics.drawable.ColorDrawable.<init>(ColorDrawable.java:47)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:357)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:262)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:125)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:389)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:548)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:533)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:533)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$70(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)