Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6808167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:55:19+00:00 2026-05-26T19:55:19+00:00

I have a library project in which I define an action bar in layout

  • 0

I have a library project in which I define an action bar in layout file action_bar.xml like this :

   <?xml version="1.0" encoding="utf-8"?>
   <merge xmlns:android="http://schemas.android.com/apk/res/android">
       <LinearLayout style="@style/actionBar" />
    </merge>

The corresponding style element is this :

<style name="actionBar">
    <item name="android:id">@id/action_bar_container</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">@dimen/title_height</item>
    <item name="android:orientation">horizontal</item>
    <item name="android:background">@drawable/action_bar_background</item>
</style>

When I try to include the action bar in another layout file dashboard_activity_layout.xml like below :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/CustomTheme"
    android:id="@+id/activity_dashboard_root_container" 
    android:orientation="vertical"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">

    <include layout="@layout/action_bar"/>

    <LinearLayout android:orientation="vertical"
            android:id="@+id/fragment_container"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:layout_weight="1" 
        android:padding="6dip">
    </LinearLayout>

</LinearLayout>

It is continuously throwing the error :

You must specifiy a valid layout reference. The layout ID @layout/action_bar is not valid.
Exception details are logged in Window > Show View > Error Log

I think this is a very simple problem and I’m missing a small detail. Any help is appreciated. I have adapted this from the Google I/O code. Does it have to do with the Library Project?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:55:20+00:00Added an answer on May 26, 2026 at 7:55 pm

    Even though eclipse gave me this error. I was able to run the app which was using the library project and the behaviour seen was the expected one. I think this is something to do with eclipse.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Flex Library project - a .swc file - which is
I have a project in vc++ which using standerd windows library and source file
I have a class library project which contains some content files configured with the
I have a project which uses a large library residing in its own repository.
I am creating a Control Library project. I have some Cursor files which i
I have a class, which is part of a code library project that was
I have a Windows Forms project in Visual Studio 2008, which references a library
In one class I have a library project with a file class1 with namespace
I have a library which supports a #define to control how it's built. However
I have a Class Library project which houses some shared code between other projects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.