Android ResourceNotFoundException in preview custom View - android

I've got a custom view, let's call it CustomView. In the initialization, I call the following method
textPaint.setTypeface(ResourcesCompat.getFont(getContext(),R.font.pretty_font));
In the app, this view works perfectly and the font is displayed as it should but the problem is that the preview of the view wont load in the editor with the following details:
android.content.res.Resources$NotFoundException: Font resource ID
0x7f090000 could not be retrieved.
at androidx.core.content.res.ResourcesCompat.loadFont(ResourcesCompat.java:365)
at
androidx.core.content.res.ResourcesCompat.getFont(ResourcesCompat.java:230)
at
com.mycompany.myapp.view.views.CustomView.init(CustomView.java:490)
at
com.mycompany.myapp.view.views.CustomView.initAttrs(CustomView.java:484)
at
com.mycompany.myapp.view.views.CustomView.(CustomView.java:116)
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:403)
at
org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:186)
at
org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:144)
at
com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:309)
at
android.view.BridgeInflater.loadCustomView(BridgeInflater.java:418)
at
android.view.BridgeInflater.loadCustomView(BridgeInflater.java:429)
at
android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:333)
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.rInflateChildren(LayoutInflater.java:824)
at
android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
at
android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at
android.view.LayoutInflater.inflate(LayoutInflater.java:394) at
com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:323)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:394)
at
com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:200)
at
com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:572)
at
com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:698)
at
java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Why won't this resource be loaded in the editor but it has no problem running in the app?
FYI, MinSdk = 21 and TargetSdk = 28

Don't call setTypeface in design mode. Use:
if (!isInEditMode()) {
textPaint.setTypeface(ResourcesCompat.getFont(getContext(),R.font.pretty_font))
}

Related

TextInputLayout error: Couldn't resolve resource #string/path_password_strike_through

AndroidX: I'm trying to use a TextInputLayout but when I put it in my XML I receive this error:
Render Problem:
Couldn't resolve resource #string/path_password_strike_through
Failed to initiate one or more classes
The following classes could not be instantiated:
com.google.android.material.textfield.TextInputLayout
Here the Stack Trace:
java.lang.AssertionError: error in parsing "g/"java.lang.NumberFormatException: For input string: "/"
at android.util.PathParser_Delegate.getFloats(PathParser_Delegate.java:366)
at android.util.PathParser_Delegate.createNodesFromPathData(PathParser_Delegate.java:183)
at android.util.PathParser_Delegate.nCreatePathDataFromString(PathParser_Delegate.java:107)
at android.util.PathParser.nCreatePathDataFromString(PathParser.java)
at android.util.PathParser.access$200(PathParser.java:24)
at android.util.PathParser$PathData.<init>(PathParser.java:76)
at android.graphics.drawable.VectorDrawable$VFullPath.updateStateFromTypedArray(VectorDrawable.java:2016)
at android.graphics.drawable.VectorDrawable$VFullPath.inflate(VectorDrawable.java:1967)
at android.graphics.drawable.VectorDrawable.inflateChildElements(VectorDrawable.java:819)
at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:717)
at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1332)
at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1291)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1266)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:330)
at android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:186)
at android.content.res.Resources.getDrawable(Resources.java:827)
at android.graphics.drawable.AnimatedVectorDrawable.inflate(AnimatedVectorDrawable.java:544)
at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1332)
at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1291)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1266)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:330)
at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:684)
at android.graphics.drawable.AnimatedStateListDrawable.parseTransition(AnimatedStateListDrawable.java:473)
at android.graphics.drawable.AnimatedStateListDrawable.inflateChildElements(AnimatedStateListDrawable.java:455)
at android.graphics.drawable.AnimatedStateListDrawable.inflate(AnimatedStateListDrawable.java:385)
at android.graphics.drawable.DrawableInflater.inflateFromXmlForDensity(DrawableInflater.java:142)
at android.graphics.drawable.Drawable.createFromXmlInnerForDensity(Drawable.java:1332)
at android.graphics.drawable.Drawable.createFromXmlForDensity(Drawable.java:1291)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1266)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:330)
at android.content.res.Resources_Delegate.getDrawable(Resources_Delegate.java:186)
at android.content.res.Resources.getDrawable(Resources.java:827)
at android.content.Context.getDrawable(Context.java:626)
at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:463)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:203)
at androidx.appcompat.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
at androidx.appcompat.content.res.AppCompatResources.getDrawable(AppCompatResources.java:102)
at androidx.appcompat.widget.TintTypedArray.getDrawable(TintTypedArray.java:76)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:344)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:247)
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:401)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:184)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:142)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:229)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:421)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:432)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:336)
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.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:327)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:386)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:450)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:590)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
I 'm trying to use more the 'android.material.xxx' than support.design.widget.
I also tried the support.design version but it doesn't seems to work :/
What might be the problem here ?
Thanks in advice.
Had the same problem..
Adding the following line of code to your TextInputLayout will fix this issue:
app:passwordToggleDrawable="#string/string_name"
Worked for me

Android Studio not rendering AppCompatButton in preview and design

I have this AppCompatButton :
<android.support.v7.widget.AppCompatButton
android:id="#+id/btn1"
android:layout_width="0dp"
style="#style/buttons_style"
android:text="#string/text1" />
But Android Studio designer preview displays it like this, how can make it update the preview show complete preview? :
There are errors in designer, saying AppCompatButton is raising exceptions while rendering :
java.lang.UnsupportedOperationException
at android.content.res.Resources_Delegate.obtainTypedArray(Resources_Delegate.java:531)
at android.content.res.Resources.obtainTypedArray(Resources.java:615)
at android.widget.TextView.<init>(TextView.java:1386)
at android.widget.Button.<init>(Button.java:166)
at android.widget.Button.<init>(Button.java:141)
at android.support.v7.widget.AppCompatButton.<init>(AppCompatButton.java:70)
at android.support.v7.widget.AppCompatButton.<init>(AppCompatButton.java:66)
at sun.reflect.GeneratedConstructorAccessor925.newInstance(Unknown Source)
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.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.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:204)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:900)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:859)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
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 guess he's missing n layout_height attribute in #style/buttons_style

The following classes Cannot instantiate- Recycler view

In my project. i accidently change the version of recycler view.when i again change that and tried to sync my project.it shows me a rendering problem.i tried clean and reubuild project.invalidate cachy and restart options but no use.someone plz help me....
Exception:
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.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.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
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)
It could be the version of appcompat you using in your build gradle, I had the same problem using
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
so I just used
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'

How to solve the Navigation View resource issue in Android Oreo?

In Android Oreo device, Navigation View always showing below mentioned issue.
W/Resources: ColorStateList android:color/text_color_primary has unresolved theme attributes! Consider using Resources.getColorStateList(int, Theme) or Context.getColorStateList(int).
java.lang.RuntimeException
at android.content.res.Resources.getColorStateList(Resources.java:990)
at android.support.design.widget.NavigationView.createDefaultColorStateList(NavigationView.java:416)
at android.support.design.widget.NavigationView.(NavigationView.java:144)
at android.support.design.widget.NavigationView.(NavigationView.java:96)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:647)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at info.androidhive.navigationdrawer.activity.MainActivity.onCreate(MainActivity.java:71)
how can i resolve this?

Android Studio failed to convert OK into a drawable

Have the following log:
java.lang.NumberFormatException: Color value 'OK' must start with #
at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:87)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:356)
at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:695)
at android.widget.LinearLayout.<init>(LinearLayout.java:238)
at android.widget.LinearLayout.<init>(LinearLayout.java:207)
at android.widget.LinearLayout.<init>(LinearLayout.java:203)
at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:134)
at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:129)
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:465)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:186)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:334)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:345)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:245)
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.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
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$53(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)
and the following error message
failed to convert OK into a drawable
The graphics preview in the layout may not be accurate
Paint setShadowLayer is not supported
I've booted up Android Studio and have a couple of views laid out on the XML; except they do not show up on the preview! I can only assume this means that android studio is not drawing whatever is on the XML; any explanation as to why? What can I do so that android studio 'draws' it?

Categories

Resources