1. Are you ready for the Galaxy S20? Here is everything we know so far!

Help with Android Studio Rendering Problems

Discussion in 'Android Development' started by Adrian Moreno, Mar 8, 2016.

  1. Adrian Moreno

    Adrian Moreno Lurker
    Thread Starter

    So I'm a game designer and I'm just starting out in the development stuff in Android Studio for Mac.
    So here's the thing I've just installed Android Studio, I have updated it, I have updated all SDK tools and the Java SDK , even reinstalled Android Studio several times and every time I open a new project I get rendering errors on all preview APIS:

    On API 23

    android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029
    at android.content.res.Resources.getResourceName(Resources.java:2235)
    at android.content.res.Resources.loadDrawableForCookie(Resources.java:2602)
    at android.content.res.Resources.loadDrawable(Resources.java:2540)
    at android.content.res.Resources.getDrawable(Resources.java:806)
    at android.content.Context.getDrawable(Context.java:458)
    at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:26)
    at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:321)
    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:180)
    at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:70)
    at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:39)
    at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:65)
    at android.support.design.widget.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:37)
    at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:109)
    at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:458)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:170)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:103)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:168)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:247)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:171)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    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:223)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
    at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
    at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:362)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
    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:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)

    On API 18

    Rendering Problems
    Invalid drawable tag vector

    An the list goes on... It wont even let me drag textviews, buttons, etc to my activity screen on design mode.
     

    Attached Files:



  2. HeavensSentSword

    HeavensSentSword Well-Known Member

    I had the same problem some times. Is there a rendering problem? Then it wont let you do anything because there is usally a circular redundancy in the code.
    But for now try just rebuilding the file and see how that works.
    Could you post the code?
     
    Adrian Moreno likes this.
  3. Adrian Moreno

    Adrian Moreno Lurker
    Thread Starter

    Sure what code exactly you want me to post? the activity_main xml file on the layout folder? I'm serious when I say I'm new to this hehe
     
  4. HeavensSentSword

    HeavensSentSword Well-Known Member

    Yes post the xml file as well as the java code that is using it.
    Also you may need to update your Gradle too that sometimes gives you rendering issues.
    Look at the lower part of the ide and look for a tab that says gradle and then see if there are any issues with the build.
     
  5. Adrian Moreno

    Adrian Moreno Lurker
    Thread Starter

    Ok I took screenshots so it's easier to look at the code. BTW Thanks for taking your time to help me, even if you don't solve my issue thanks a lot.
     

    Attached Files:

  6. Deleted User

    Deleted User Guest

    Your rendering problems are I think related to the FloatingActionButton in your activity_main layout.
    For some reason the ic_dialog_email image resource can not be located by the system.
     
  7. Adrian Moreno

    Adrian Moreno Lurker
    Thread Starter

    Can't believe I have such a problem when just starting on this development stuff..... I haven't even written a single line of code and this happens.
     
  8. Deleted User

    Deleted User Guest

    I can understand your frustration, but I think you may have got something fundamentally wrong with the install of your Android development tools. In Android Studio, check the Gradle Console window. Does it report any build errors or problems in your environment?
     
  9. Adrian Moreno

    Adrian Moreno Lurker
    Thread Starter

    Do you mean this one? Cause everything seems to be working correctly
     

    Attached Files:

  10. GuyMeredith

    GuyMeredith Lurker

    Hi Adrian - did you ever get this rendering issue resolved? I have the same issue, and am equally frustrated! Any advice you can give would be appreciated.
     
  11. steve

    steve Developer
    Administrator

    Just my few cents... you can add a extra src to only display in the tools. This will solve your issue if the vector is somehow causing the rendering issues.

    For example:
    Code (Java):
    1. <ImageButton
    2.         android:id="@+id/btn_example"
    3.         android:layout_width="@dimen/comment_actions_height"
    4.         android:layout_height="@dimen/comment_actions_height"
    5.         android:src="@drawable/vector_causing_render_issues"
    6.         android:background="?android:selectableItemBackground"
    7.         android:visibility="visible"
    8.         tools:src="@drawable/vector_or_drawable_for_tools_only"/>
     
Loading...
Similar Threads - Help Android Studio
  1. Sheraz Ahmed
    Replies:
    0
    Views:
    560
  2. Ajaykumar Panchamoorthy
    Replies:
    2
    Views:
    296
  3. Ultrasavage
    Replies:
    0
    Views:
    163
  4. Deepak SJ
    Replies:
    1
    Views:
    432
  5. Aseem Chishti
    Replies:
    0
    Views:
    368
  6. Mekhi Greene
    Replies:
    3
    Views:
    573
  7. Pranav_bhattarai
    Replies:
    0
    Views:
    353
  8. Samson0590
    Replies:
    6
    Views:
    505
  9. soham raut
    Replies:
    0
    Views:
    290
  10. aio developers
    Replies:
    8
    Views:
    619

Share This Page

Loading...