dewango/BottomNavigationBarXF

Error encountered while duplicating sample project (written in XAML)

Closed this issue ยท 2 comments

Hey guys ๐Ÿ‘‹

I tried replicating the sample project written in XAML, and I've run into this error, as shown below:

Bridge [resources.resolve.theme] Failed to find '?attr/selectableItemBackgroundBorderless' in current theme. Trying to load class android.support.v4.widget.Space

Bridge [resources.resolve.theme] Failed to find '?attr/selectableItemBackgroundBorderless' in current theme.
Trying to load class android.support.v4.widget.Space

Bridge [resources.resolve.theme] Failed to find '?attr/selectableItemBackgroundBorderless' in current theme.
Trying to load class android.support.v4.widget.Space

Bridge [resources.resolve.theme] Failed to find '?attr/selectableItemBackgroundBorderless' in current theme.
Trying to load class android.support.v4.widget.Space

Bridge [resources.resolve.theme] Failed to find '?attr/selectableItemBackgroundBorderless' in current theme.
Trying to load class android.support.v4.widget.Space

mono.android.DesignerException: java.lang.NullPointerException
at mono.android.DesignerException.fromThrowable(DesignerException.java:46)
at mono.android.DesignerSession.checkRenderResultForError(DesignerSession.java:187)
at mono.android.DesignerSession.load(DesignerSession.java:239)
at mono.android.DesignerSession.processMessage(DesignerSession.java:702)
at mono.android.MessageListener.executeMessage(MessageListener.java:88)
at mono.android.MessageListener$Runner.run(MessageListener.java:44)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at android.graphics.Canvas_Delegate.native_getClipBounds(Canvas_Delegate.java:457)
at android.graphics.Canvas.native_getClipBounds(Canvas.java)
at android.graphics.Canvas.getClipBounds(Canvas.java:949)
at android.text.Layout.getLineRangeForDraw(Layout.java:494)
at android.text.Layout.draw(Layout.java:241)
at android.text.BoringLayout.draw(BoringLayout.java:407)
at android.widget.TextView.onDraw(TextView.java:5862)
at android.view.View.draw(View.java:17071)
at android.view.View.draw(View.java:16979)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:17074)
at android.view.View.draw(View.java:16979)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:17074)
at android.view.View.draw(View.java:16979)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:16977)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3764)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
at android.view.View.draw(View.java:17074)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:401)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:548)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:422)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:434)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368)
at mono.android.DesignerSession.load(DesignerSession.java:233)
... 4 more


Any idea why this might be happening? This is what my styles.xml file looks like, if that's relevant:

<?xml version="1.0" encoding="utf-8" ?>
<resources>

  <style name="MainTheme" parent="MainTheme.Base">
  </style>
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette -->
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">#2196F3</item>
    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">#1976D2</item>
    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <item name="colorAccent">#FF4081</item>
    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight and colorSwitchThumbNormal. -->
    <item name="windowActionModeOverlay">true</item>

    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
  </style>

  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#FF4081</item>
  </style>
</resources>

Thanks for all the work you've put into this library! Appreciate all the help. โค๏ธ

Hi @yeskunall,

Did you resolve the issue? :)

@henningms, I just ended up initializing the BottomBar programatically instead. I can't comment on whether it works if you use it declaratively in XAML, but if I get a response from the guys, I can debug the issue.