UNFORTUNATELY, I am having problem with the RecyclerView
class. After adding the RecyclerView class in the dependencies I created the fragment_crime_list.xml
file and since then I am getting the error :-
Failed to instantiate one or more classes :
The following class could not be instantiated :-
-android.support.v7.widget.RecyclerView(Open class,Show Exception)
and the exception details are :
java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener
at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:180)
at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:61)
at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:118)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:213)
at android.support.v7.widget.RecyclerView.initAutofill(RecyclerView.java:702)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:629)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:601)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:481)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:264)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:222)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:209)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:678)
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)
I have already tried all other methods given by other people but non of them seem to work.
- I rebuilt the project a number of times but them didnât solve the problem.
- I tried to change the SDK versions in the
build.gradle
file âas suggested by many other people on this forumâ - I also tried to âClean Projectâ and âInvalidate Caches/Restartâ again âas suggested by many other people on this forumâ
and a few other ways suggested by people on the internet.
When I wasnât able to solve the problem then I updated everything and now I am presently working with Android 3.1.3 and also with an upgraded Gradle, but non of it seems to solve the problem.
Any kind of help from anyone will be really nice
PLEASE HELP