Rendering problems

0 Bert Hoekstra · October 21, 2015
Hi all,

After changing the AppTheme, i get this error:


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:34)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:178)
at android.support.design.widget.CoordinatorLayout.<init>(CoordinatorLayout.java:172)
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:422)
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:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:218)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:145)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
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: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:366)
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: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)


Can someone tell me what i have to do?

Thx a lot. :)

Post a Reply

Replies

Oldest  Newest  Rating
0 Aaron Chan · October 28, 2015
I have a similar error. 

I tried to changed the theme in Android Studio so I can get the menu button (three dots). But no matter what theme I choose I cannot get the menu button to show up.

I am currently doing the overflow menu tutorial 

https://www.youtube.com/watch?list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl&v=iwE1bnRlZw0
0 Gary Whitney · October 30, 2015
Arron
I made 2 notes when I did that tutorial:
1. The overflow menu was not showing up in a new blank activity, in Design and Preview, but is there in the emulator:
2. ActionBarActivity  is depreciated. Use AppCompatActivity instead.

There is a strong relationship between your Activity and The theme. I haven't fully comprehended it yet.
Maybe some will post a reply that explains it.
0 Gary Whitney · October 22, 2015
I have been seeing several posts about this App Theme problem.
The good news is you can still continue the tutorials. Just don't change the theme.

Some things to note:
1. When Bucky create tutorial # 4 He was not using Version 23.
Android is constantly evolving and things become depreciated.
2. Are you trying to follow and old example that changes the type of Activity?.
#4 is using ActionBarActivity but you may be using AppCompatActivity
3. Is your min API using features not supported by Material?
#3 suggest using API 8. There are a lot of features not going to be on hardware that old.
I suggest using a min of API16 with V23.

Here are some places to look at for clues.
1. What is your min API?
2. What is your activity.?
Try - public class MainActivity extends AppCompatActivity {
and
import android.support.v7.app.AppCompatActivity;
3.Check your style
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>

Let me know if this helps or if you figure out the problem.
P.S.
I am not sure if you are missing a library during the installation process. This is rare but It happened to me with V23.
If the above didn't work i will show you my SDK manager. in a reply.
  • 1

Java / Android Development

106,927 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator