Android Studio Err Msg: Render Problem. Failed to find sytle 'coordinatorLayoutStyle' in current theme.

  • Replies:14
  • Answered
Saleem
  • Forum posts: 2

May 29, 2018, 8:30:02 PM via Website

Android Studio 3.1.2.
I am creating a very simple hello world App. No changes, everything uses default values.
Using a new basic activity, rest is default values. Everything works, except that on the top left corner of the design screen, where it shows "Warnings and Errors", I have 1 error. Error text is Render problem. Failed to find style 'coordinatorLayoutStyle' in current theme. Tip: Try to refresh the layout.
Refreshing does not help. I looked in the Theme Editor. As error indicates, there is no style 'coordinatorLayoutStyle' in current theme.
I also looked in styles.xml. I don't see 'coordinatorLayoutStyle'
How to resolve this error?
The application works fine, but

Reply
Best answer
James Watson
  • Forum posts: 1,584

May 30, 2018, 3:50:45 AM via Website

Insert this line as below into the application theme.

<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>

— modified on May 30, 2018, 3:54:34 AM

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Jul 9, 2018, 1:07:54 PM via Website

Hi there,

As a complete noobie in this field i have the same issue. but where do i add these lines?
Under R.values.styles in the styles.xml i found similar lines but when i delete thoses and add these it gives me an error messege.

these are the lines already there

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

and when i replace them with your lines it marks @style/Widget.Design.CoordinatorLayout with red and gives tme the error messege:
Cant resolve symbol '@style/Widget.Design.CoordinatorLayout'
Validates recource reference inside Android XML files.

Thx for any Help,
Leon

— modified on Jul 9, 2018, 1:14:01 PM

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Jul 9, 2018, 1:25:25 PM via Website

James Watson

Insert this line as below into the application theme.

<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>

I just forgot to Quote your comment in mine :)

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Jul 10, 2018, 5:06:14 AM via Website

Add the two dependencies in your build.gradle(app) :
dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
}

And, instead of 27.0.2, use your library version( i.e 28.x.x ).

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Jul 10, 2018, 10:17:11 AM via Website

James Watson

Add the two dependencies in your build.gradle(app) :
dependencies {
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
}

And, instead of 27.0.2, use your library version( i.e 28.x.x ).

Thanks alot for the fast reply.

Those 2 dependencies are already my build.gradle(app) but its 28.0.0-apha3.

Does that change anything?

Leon

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Jul 10, 2018, 10:54:11 AM via Website

If you already have those 2 dependcies, then keep your old style name="AppTheme.NoActionBar" and try to build. Do you have any error messages?

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Jul 10, 2018, 12:11:02 PM via Website

James Watson

If you already have those 2 dependcies, then keep your old style name="AppTheme.NoActionBar" and try to build. Do you have any error messages?

I can build but i still get an error:
Render Problem
Failed to find style 'coordinatorLayoutStyle' in current theme

On a different forum i found out that if you change the 28.0.0-alpha3 to 28.0.0-alpha1 then it sovles the Render Problem
Failed to load AppCompat ActionBar with unknown error.

but now if im getting the Error NullPointerException and i dont know why

Full Error code incase it helpes:

null
java.lang.NullPointerException
at com.android.tools.idea.common.surface.DesignSurface.setModel(DesignSurface.java:265)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.initNeleModel(NlPreviewForm.java:420)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.initPreviewForm(NlPreviewForm.java:309)
at com.android.tools.idea.uibuilder.editor.NlPreviewForm.setNextEditor(NlPreviewForm.java:289)
at com.android.tools.idea.uibuilder.editor.NlPreviewManager$2.run(NlPreviewManager.java:279)
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.lambda$flush$1(MergingUpdateQueue.java:277)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2816)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:288)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:417)
at com.intellij.util.Alarm$Request.access$700(Alarm.java:344)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:384)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Jul 10, 2018, 1:54:22 PM via Website

By 'keep your old style…', I mean that style without 'coordinatorLayoutStyle' in your style.xml.
If that, will you still get error msg 'Failed to find style 'coordinatorLayoutStyle' ?

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Jul 10, 2018, 2:41:49 PM via Website

James Watson

By 'keep your old style…', I mean that style without 'coordinatorLayoutStyle' in your style.xml.
If that, will you still get error msg 'Failed to find style 'coordinatorLayoutStyle' ?

I dont have a style with coordinator in it :/ .

This is the code in styles.xml

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

There also is a styles.xml (v21) what is that and what does it mean?

Code from that one:

<resources>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

Helpful?
Reply
Mansi Trivedi
  • Forum posts: 4

Jul 10, 2018, 4:08:04 PM via Website

The Codes and Programmes written over here is damn perfect and perfect solution for the queries over here, I would really like to thank the developers for sharing it. Really appreciate it .

Helpful?
Reply
James Watson
  • Forum posts: 1,584

Jul 21, 2018, 1:21:19 PM via Website

My android studio is only V2.2.3. I could not reproduce the issue when I created a new simple 'hello world' app today at home.
Hope some friends else with the V3.1.2 of Android Studio will help you. Sorry.

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply
goldy tan
  • Forum posts: 1

Jul 27, 2018, 5:26:32 AM via Website

On a different forum i found out that if you change the 28.0.0-alpha3 to 28.0.0-alpha1 then it sovles the Render Problem

I'm using android studio 3.1.2 and got same problem. When i change the library from alpha3 to alpha1, it works. If you still got errors, maybe you need to rebuild

Helpful?
Reply
Leon Vienna
  • Forum posts: 6

Sep 18, 2018, 1:35:48 PM via Website

Hey, its been some time since i checked back on this post since i managed to fix the issue with your idea. but untis now i have always been using empty activities. today its the first time i am using a basic activity. aaaaand the problem is back. If you have any ideas id be thrilled to hear them!!!

Helpful?
Reply
Kazuhisa Noguchi
  • Forum posts: 1

Sep 21, 2018, 10:01:39 AM via Website

Hello,

I am actually getting the same trouble, and your answer will be very helpful.

However, I am not sure where exactly should I put the code you mentioned (below)

<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>

I am opening "content_main.xml" on Android Studio.
And do not know where exactly.

Thank you

Helpful?
Reply