Reputation: 423
So the app works fine in android 7.0, but the toolbar is not Visible in android 4.4 kitkat. The toolbar is still there as navigation drawer still opens if user clicks on blank space where hamburger icon should have been.
The render error is there in activity xml file which includes a app_bar_layout xml file where the error is pointing to.
This is the error in XML render issue:
//Exception raised during rendering: Can't make a decor toolbar out of CoordinatorLayout
java.lang.IllegalStateException: Can't make a decor toolbar out of CoordinatorLayout
at android.support.v7.widget.ActionBarOverlayLayout.getDecorToolbar(ActionBarOverlayLayout.java:543)
at android.support.v7.widget.ActionBarOverlayLayout.pullChildren(ActionBarOverlayLayout.java:532)
at android.support.v7.widget.ActionBarOverlayLayout.fitSystemWindows(ActionBarOverlayLayout.java:282)
at android.view.View.onApplyWindowInsets(View.java:7755)
at android.view.View.dispatchApplyWindowInsets(View.java:7809)
at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:6435)
at android.view.ViewGroup.dispatchApplyWindowInsets(ViewGroup.java:6439)
at android.view.ViewRootImpl.dispatchApplyInsets(ViewRootImpl.java:1422)
at android.view.ViewRootImpl_Accessor.dispatchApplyInsets(ViewRootImpl_Accessor.java:24)
at com.android.layoutlib.bridge.impl.Layout.requestFitSystemWindows(Layout.java:315)
at android.view.View.requestFitSystemWindows(View.java:7945)
at android.view.View.requestFitSystemWindows(View.java:7945)
at android.view.View.requestFitSystemWindows(View.java:7945)
at android.view.View.requestFitSystemWindows(View.java:7945)
at android.view.View.requestApplyInsets(View.java:7953)
at android.support.v4.view.ViewCompatLollipop.requestApplyInsets(ViewCompatLollipop.java:49)
at android.support.v4.view.ViewCompat$LollipopViewCompatImpl.requestApplyInsets(ViewCompat.java:1630)
at android.support.v4.view.ViewCompat.requestApplyInsets(ViewCompat.java:2970)
at android.support.design.widget.CoordinatorLayout.onAttachedToWindow(CoordinatorLayout.java:246)
at android.view.View.dispatchAttachedToWindow(View.java:15395)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2953)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:333)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680)
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 changing the coordinate layout to other layouts but it didn't work.
Upvotes: 1
Views: 2789
Reputation: 132
You probably have android:id
attribute when including toolbar's layout like this:
<include
android:id="@+id/toolbar_layout"
layout="@layout/toolbar" />
I just removed id to get this code:
<include
layout="@layout/toolbar" />
Then I force refreshed layout. You can do it here.
It worked for me.
Upvotes: 4