我正在按照本教程http://www.androidhive.info/2015/04/android-getting-started-with-material-design/开始使用材料设计,但一直收到这个错误,我不知道如何解决这个问题,到目前为止我已经在不同的网站上尝试了所有内容。
我在Ubuntu上使用android studio 1.3。
以下是错误的详细信息。
java.lang.ClassNotFoundException: android.support.v4.widget.DrawerLayoutImpl
at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:144)
at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:54)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at com.android.tools.idea.rendering.RenderClassLoader.defineClassAndPackage(RenderClassLoader.java:211)
at com.android.tools.idea.rendering.RenderClassLoader.loadClassFromJar(RenderClassLoader.java:91)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClassFromModuleOrDependency(ModuleClassLoader.java:158)
at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:139)
at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:54)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:205)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:150)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:93)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:413)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:511)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:499)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:499)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:611)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:363)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:608)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:630)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
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)
答案 0 :(得分:1)
尝试将此添加到您的gradle依赖项
compile 'com.android.support:support-v4:22.2.0'