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

  • SEARCH
  • Home
  • 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 8177661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:34:07+00:00 2026-06-06T23:34:07+00:00

I have been working with elcipse for a couple of weeks now. My code

  • 0

I have been working with elcipse for a couple of weeks now. My code has functioned properly but all of a sudden it has stopped working. I get this error,

main.xml: You must specifiy a valid layout reference. The layout ID @layout/required is not valid.

my XML code

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">


    <!--  select between BIN or auction -->
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="horizontal" >

    <Button
        android:id="@+id/AuctionButton"
        android:layout_marginLeft="82dp"
        android:layout_width="119dp"
        android:layout_height="wrap_content"
        android:onClick="showAuctionOptions"
        android:text="Auction" />


    <Button
        android:id="@+id/BINButton"
        android:layout_marginLeft="-2dp"
        android:layout_width="119dp"
        android:layout_height="wrap_content"
        android:onClick="showAuctionOptions"
        android:text="Buy it now" />

    </LinearLayout>

        <include android:id="@+id/cell1" layout="@layout/required"/>

        <include android:id="@+id/cell2"  layout="@layout/gray_line" />

        <!--**  Show if Buy it now is selected **-->
        <include android:id="@+id/cell3" layout="@layout/buyitnow" />
        <!-- ** End Buy it now display ** -->

        <!--** Show if auction selected ** -->
        <include android:id="@+id/cell4" layout="@layout/auction" />

        <include android:id="@+id/cell5"  layout="@layout/gray_line" />

        <include android:id="@+id/cell6" layout="@layout/addons" />

        <include android:id="@+id/cell7" layout="@layout/calculate" />      

</LinearLayout>

</ScrollView>

the error is with the first include, however if I remove that, I just get an error with the second include. If I remove all of the include, I get a ‘could not resolve R’ error within my java code.

What I have tried,

  • cleaning the project
  • restarting eclipse
  • rebooting my computer

this is my AndroidManifest XML file,

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="toggler.state"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name=".TogglerActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

none of which have worked.Could anyone help please?

Thanks

  • 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-06-06T23:34:09+00:00Added an answer on June 6, 2026 at 11:34 pm

    The error is probably caused elsewhere in the layout. Remove the extra two xmlns:android="http://schemas.android.com/apk/res/android"

    The xmlns is used to define a namespace. Only the top element can have it in most cases.

    Take a look at What does "xmlns" in XML mean? if anyone wants to read about the xmlns explanation.

    Also check to make sure your XML files are all lowercase.

    Also try to see if you have the correct package specified in your manifest. Taken from https://stackoverflow.com/a/7496766/935779

    It is worth checking in AndroidManifest.xml. The attribute package has
    the correct value.

    That is, <manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="your.correct.package.name" ...

    After you change that, the R.java will be re-generated.

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >
    
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
    
    
            <!--  select between BIN or auction -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:orientation="horizontal" >
    
            <Button
                android:id="@+id/AuctionButton"
                android:layout_marginLeft="82dp"
                android:layout_width="119dp"
                android:layout_height="wrap_content"
                android:onClick="showAuctionOptions"
                android:text="Auction" />
    
    
            <Button
                android:id="@+id/BINButton"
                android:layout_marginLeft="-2dp"
                android:layout_width="119dp"
                android:layout_height="wrap_content"
                android:onClick="showAuctionOptions"
                android:text="Buy it now" />
    
            </LinearLayout>
    
            <include android:id="@+id/cell1" layout="@layout/required"/>
    
            <include android:id="@+id/cell2"  layout="@layout/gray_line" />
    
            <!--**  Show if Buy it now is selected **-->
            <include android:id="@+id/cell3" layout="@layout/buyitnow" />
            <!-- ** End Buy it now display ** -->
    
            <!--** Show if auction selected ** -->
            <include android:id="@+id/cell4" layout="@layout/auction" />
    
            <include android:id="@+id/cell5"  layout="@layout/gray_line" />
    
            <include android:id="@+id/cell6" layout="@layout/addons" />
    
            <include android:id="@+id/cell7" layout="@layout/calculate" />      
    
        </LinearLayout>
    
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on packing a project lately but it has turned into
I have been trying for several hours now to get sorl-thumbnail working, but it
Okay so i have been working on this app for a couple months now
Have been working on this question for a couple hours and have come close
I have been working on a project on and off, but I haven't touched
I have been working with Zend for a few months now and am at
I have been working with eclipse and android for a few months now and
I have an Eclipse project I've been working on for some time now, and
i have been working on developing an blackberry application. as per now i want
I am EXTREMELY new to the html/php scene but I have been working at

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.