I am having this issue with Rendering problems every time i open a project.
java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:36)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:192)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:186)
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.inflate(LayoutInflater.java:495)
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$72(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)
Screenshot of the problem
I don't know how to fix it permanently, or why this is happening repeatedly.
I read up on it and someone suggested that I Change the theme to the following:
theme change
I did that, and it takes care of the problem for the session, but as soon as i close android studio ad open it back up again, i am greeted by the sae problem.
What am I doing wrong here?
How can I fix this for good?
Restart Android Studio by invalidating the caches
File → Invalidate Caches / Restart.
This may fix the issue.
For more information visit this site
Alternative Solution
Use a higher SDK as the minimum SDK like lollipop or marshmallow when building the project. If you really want to use a lower SDK as the minimum SDK, start from blank activity and develop from there onwards
on the very first line of your log cat its already telling you
java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
follow as it says.
Related
I'm an Android Studio user who has recently experienced the Rendering Problem...
Usually when there is a rendering problem, all cases that I searched have messages - type missing, known bug, etc.
However, there was no error message for my case, and it just says, "Rendering Problems."
I tried many things like:
Converting API Versions
Rebuild / Refresh
Invalidating Cashe
SDK Version Update
Remaking the XML files
Restarting the project / Rebooting
And plenty of not useful solutions
And the following detail is shown below:
java.lang.NullPointerException
at android.graphics.Paint_Delegate.reset(Paint_Delegate.java:1238)
at android.graphics.Paint_Delegate.<init>(Paint_Delegate.java:1179)
at android.graphics.Paint_Delegate.nInit(Paint_Delegate.java:675)
at android.graphics.Paint.nInit(Paint.java)
at android.graphics.Paint.<init>(Paint.java:457)
at android.graphics.drawable.ColorDrawable.<init>(ColorDrawable.java:47)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:357)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:262)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:125)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301)
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$70(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)
i found solution ,and i replace new 2.3.3 as ,and use 1.0.2
all of the question render problem solved!!!
Cause the problem that IDE AS 1.0.2 use actionbar !
But as2 etc looks like OLD ACTIONBAR DEPRECIATED!
I am making an Android app and trying to use an ActionBar.
I am getting the following error in the log:
UnsupportedMethodException
Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
And this error for the layout:
Rendering Problems Unable to find the layout for Action Bar.
Consider updating to a more recent version of appcompat, or switch the
rendering library in the IDE down to API 21 (Details) Tip: Try to
refresh the layout.
When I tried reducing the SDK version to 20 or 21 it did not help.
Has anyone been able to solve this?
The details about action bar? I guess it is ,but I am not sure?
Rendering Problems (Details)
java.lang.RuntimeException: Unable to find the layout for Action Bar.
at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:57)
at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:59)
at com.android.layoutlib.bridge.impl.Layout.createActionBar(Layout.java:238)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:150)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301)
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$70(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)
I tried to include check boxes in the layout and after dragging and dropping I get this error:
exception raised during rendering:Binary XML file line #-1:error
inflating class<unknown>.
xml file:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.example.nidhigupta.shopping2.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="#+id/textView" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New CheckBox"
android:id="#+id/checkBox"
android:layout_below="#+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
please provide step by step solution.
details link says :
java.lang.NoSuchMethodError: android.graphics.drawable.VectorDrawable_Delegate.nCreateTreeFromCopy(JJ)J
at android.graphics.drawable.VectorDrawable.nCreateTreeFromCopy(VectorDrawable.java)
at android.graphics.drawable.VectorDrawable.access$400(VectorDrawable.java:204)
at android.graphics.drawable.VectorDrawable$VectorDrawableState.createNativeTreeFromCopy(VectorDrawable.java:837)
at android.graphics.drawable.VectorDrawable$VectorDrawableState.<init>(VectorDrawable.java:812)
at android.graphics.drawable.VectorDrawable.mutate(VectorDrawable.java:268)
at android.graphics.drawable.DrawableContainer$DrawableContainerState.addChild(DrawableContainer.java:817)
at android.graphics.drawable.StateListDrawable$StateListState.addStateSet(StateListDrawable.java:329)
at android.graphics.drawable.AnimatedStateListDrawable$AnimatedStateListState.addStateSet(AnimatedStateListDrawable.java:602)
at android.graphics.drawable.AnimatedStateListDrawable.parseItem(AnimatedStateListDrawable.java:525)
at android.graphics.drawable.AnimatedStateListDrawable.inflateChildElements(AnimatedStateListDrawable.java:453)
at android.graphics.drawable.AnimatedStateListDrawable.inflate(AnimatedStateListDrawable.java:385)
at android.graphics.drawable.DrawableInflater.inflateFromXml(DrawableInflater.java:130)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1224)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1197)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:315)
at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:681)
at android.widget.CompoundButton.<init>(CompoundButton.java:89)
at android.widget.CheckBox.<init>(CheckBox.java:70)
at android.widget.CheckBox.<init>(CheckBox.java:66)
at android.widget.CheckBox.<init>(CheckBox.java:62)
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 android.view.LayoutInflater.createView(LayoutInflater.java:645)
at android.view.BridgeInflater.onCreateView(BridgeInflater.java:107)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:149)
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:317)
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)
UPDATE Sep/2016
Issue is no longer reproducible on Android Studio v2.2. Update your Android Studio and the issue will be no longer reproducible.
UPDATE Aug/2016
Issue is still happening in Android Studio v2.1.3
Original Answer
It seems this is an issue and it is being handled by google HERE:
Some other people are facing the same issue and the fix is always to change the preview API from 24 to 23 (or any other version).
You may need to download a previous version of SDK.. You don't need to change your build.gradle... Just download the SDK and Android Studio will allow you to change the SDK in Layout Preview
Rendering Problem Related Issue is Resolved Check out the Answer here that says
android studio pick Automatically Pick Best by default
so you have to select previous one API 23 manually.
I have similar issue and resolve it by manage pixel sizes of drawables and width-height of controls in xml file. Please do not add any controls in xml file which is not used in class file.
I had a similar problem. I resolved it by decreasing the size of the images in the drawable folder.
You can try to change the AppTheme.
I have selected the previous version as suggested but still did not see the previous image.
What I did was this:
In the list of versions selected the " previous version " and "Preview Androids Versions " .
Once the screens appear earlier versions of android I click on one of the previous and drag on the image layout that does not images.
To me it worked well , I hope and serve them . We're reading .
I was using API 22, though API 25 was available on my System.
Moving the problematic tab between different split views did the trick in a second.
I've had this exception before and what worked for me was File -> Invalidate Caches/Restart.
You may try that, but you should know that all of the Local History will be deleted.
Edit: Downgrading from API 24 to API 23 also works.
I'm trying out the new Android Studio 2.2 Preview, and for some reason the layout editor isn't working for layouts that were created in the old version. It keeps telling me various resources aren't found... (Such at the file that I just opened.)
Am I missing something? Is there soemthing I'm unaware of that I should have done when opening an old project?
It seems to be fine when I create a new layout. It's only the previously created layouts and menus that seem to have an issue.
Anyone else experiencing this?
I've tried cleaning, and rebuilding the project.
EDIT
Ok interesting- the problem seems to only happen for layouts that include other layouts. If I remove the include statement it renders fine, but if I add it back, it can't find the included item and gives me an issue. (Even though I can apparently open the included layout itself, and it renders just fine...)
UPDATE
Apparently it only seems to happen with the merge tag. If the layout being included uses the merge tag it won't render and I get the below error. If I remove the merge, and just use another layout tag it seems to work fine.
android.content.res.Resources$NotFoundException: Could not find layout resource matching value 0x7FFF03A2 (resolved name: item_monster_edit) in current configuration.
at android.content.res.Resources_Delegate.throwException(Resources_Delegate.java:913)
at android.content.res.Resources_Delegate.throwException(Resources_Delegate.java:900)
at android.content.res.Resources_Delegate.getLayout(Resources_Delegate.java:437)
at android.content.res.Resources.getLayout(Resources.java:1111)
at android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:136)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:902)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:854)
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.rInflate_Original(LayoutInflater.java:861)
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.rInflate_Original(LayoutInflater.java:861)
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:317)
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:549)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:534)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:534)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$41(RenderTask.java:660)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:380)
at com.android.tools.idea.rendering.RenderTask.inflate(RenderTask.java:660)
at com.android.tools.idea.uibuilder.model.NlModel.inflate(NlModel.java:321)
at com.android.tools.idea.uibuilder.model.NlModel.render(NlModel.java:378)
at com.android.tools.idea.uibuilder.surface.DesignSurface$3.modelChanged(DesignSurface.java:794)
at com.android.tools.idea.uibuilder.model.NlModel.lambda$notifyListenersModelUpdateComplete$52(NlModel.java:454)
at java.lang.Iterable.forEach(Iterable.java:75)
at com.android.tools.idea.uibuilder.model.NlModel.notifyListenersModelUpdateComplete(NlModel.java:454)
at com.android.tools.idea.uibuilder.model.NlModel.updateModel(NlModel.java:368)
at com.android.tools.idea.uibuilder.model.NlModel$1.run(NlModel.java:231)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:333)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:323)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:267)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:282)
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:378)
at com.intellij.util.Alarm$Request.run(Alarm.java:389)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:187)
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)
You probably solved this already but I had the same problem with the same error. Always with included layouts.
The solution was to invalidate cache /restart in Android studio. Now it is working and the preview shows the layout with the included layout.
Press Ctrl+Shift+A (Cmd+Shift+A on Mac?)
Write "invalidate"
Select "Invalidate Caches / Restart"
Seems many developers been experiencing this issue. You can star it here 211183
If you cant wait for Tools guys to fix it, switch to older Studio versions. 2.1 should work fine.
Edit: Fixed in Preview 5
Just remove these lines and may b it will get fixed
android:background="?android:attr/windowTitleStyle">
This happens wen u the attributes arent set properly.
I have the following error in my preview window in the latest version of Android Studio (1.2) that stops me from being able to view the layout I am creating, I have tried restarting android studio several times as well as cleaning, rebuilding the project and restarting my computer
EDIT:
Some projects have the same error while other older projects work fine
The following classes could not be instantiated:
- android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)
Exception Details
java.lang.NoClassDefFoundError: android/support/v7/internal/widget/ActionBarOverlayLayout$1
at android.support.v7.internal.widget.ActionBarOverlayLayout.<init>(ActionBarOverlayLayout.java:93)
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:413)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:177)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:84)
at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:56)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.createActionBar(RenderSessionImpl.java:1691)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:362)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:644)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:79)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:581)
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)
Try changing your base application theme using below code - in res/values/styles.xml
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
OR
Also you can try Switching the preview's API level to lower one from the preview configuration
You can also update Gradle to version 1.2.3 as explained here:
https://code.google.com/p/android/issues/detail?id=171417
Apparently this was a bug on version 1.2.2 of Gradle and from the next version of Android studio Gradle 1.2.3 will be the default on new projects.
At least it worked for.
While Base.Theme.AppCompat.... is the superclass of Theme.AppCompat.... anyway, I prefer the fix using the new version of Gradle.
Worked for me, hope it works for you.
Also I had to Clean and Rebuild the Project.
The easiest way would be to change the theme of the application by clicking AppTheme.
This does not need to change anything in the code.
I attach the image below
AppTheme example of solution render problem android studio