Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.ClassNotFoundException: android.support.v4.view.TintableBackgroundView

In Android Studio I was developing for minSdkVersion 19, when I changed it to 21 the following error appeared in all my layouts:

java.lang.ClassNotFoundException: android.support.v4.view.TintableBackgroundView
    at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:181)
    at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:56)
    at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:119)
    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:214)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
    at com.android.tools.idea.rendering.RenderClassLoader.defineClassAndPackage(RenderClassLoader.java:177)
    at com.android.tools.idea.rendering.RenderClassLoader.loadClassFromJar(RenderClassLoader.java:92)
    at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:171)
    at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:56)
    at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:119)
    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:214)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:500)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:254)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:215)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadClass(LayoutlibCallbackImpl.java:218)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:336)
    at android.view.BridgeInflater.onCreateView(BridgeInflater.java:155)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:720)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:225)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:90)
    at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:52)
    at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:46)
    at com.android.layoutlib.bridge.impl.Layout.createNavBar(Layout.java:325)
    at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:151)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:288)
    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:547)
    at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:681)
    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)

Every single one of my layouts shows the exact same error. So I rolled back to minSdkVersion 19 but the exceptions persists. I tried adding several support libraries in gradle but none of them worked. Any ideas what I did wrong?

like image 808
Alan Ortega Avatar asked Nov 28 '17 16:11

Alan Ortega


1 Answers

I was having the same problem. I just updated the version of android.support.v4 from 25.0.1 to 27.0.1 and worked fine

like image 145
Diego Souza Avatar answered Nov 06 '22 04:11

Diego Souza