报错 java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
2015-09-05
java.lang.NoClassDefFoundError: com/android/util/PropertiesMap
at com.android.layoutlib.bridge.android.BridgeContext.createStyleBasedTypedArray(BridgeContext.java:940)
at com.android.layoutlib.bridge.android.BridgeContext.obtainStyledAttributes(BridgeContext.java:638)
at android.content.res.Resources_Theme_Delegate.obtainStyledAttributes(Resources_Theme_Delegate.java:71)
at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java:1436)
at android.widget.TextView.<init>(TextView.java:761)
at android.widget.TextView.<init>(TextView.java:704)
at android.widget.TextView.<init>(TextView.java:700)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:50)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:45)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:41)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:163)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:95)
at com.android.layoutlib.bridge.bars.StatusBar.<init>(StatusBar.java:67)
at com.android.layoutlib.bridge.impl.Layout.createStatusBar(Layout.java:222)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:144)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:297)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:520)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:508)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:508)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:75)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:620)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:371)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:639)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
请问这是什么问题
搞了3个多小时终于解决了,
我的compileSdkVersion 23,
在dependencies中添加依赖compile 'com.android.support:recyclerview-v7:23.3.0'
注意,v7后的版本要和appcompat的一致,
例如:compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
都是23.3.0
另外<android.support.v7.widget.RecyclerView>标签要这么写!
希望可以帮到同样问题的朋友.
遇到了同样问题,请教具体的解决方法,多谢。
java.lang.ClassNotFoundException: android.support.v7.recyclerview.R$styleable
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/recyclerview/R$styleable;
android.view.InflateException: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView
。。。。。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myrecyclerview/com.example.myrecyclerview.MainActivity}: android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class android.support.v7.widget.RecyclerView
举报