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 7630789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:11:21+00:00 2026-05-31T06:11:21+00:00

i am creating an android application, a simple calculator, but i am getting an

  • 0

i am creating an android application, a simple calculator, but i am getting an “[2012-03-12 20:22:21 – Calculator] Error in an XML file: aborting build.” which i couldn’t solve. could you identify the problem?

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

<LinearLayout 
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

<EditText
    android:id="@+id/txtResult"
    android:layout_width="fill_parent"
    android:layout_height="54dp"
    android:inputType="number"
    android:singleLine="true"
    android:text="@string/result"
    android:editable="false" 
    android:gravity="right">
</EditText>

</LinearLayout>
<LinearLayout 
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

 <Button
     android:id="@+id/button1"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_weight="1.25"
     android:text="@string/number1" />

 <Button
     android:id="@+id/button2"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_weight="1.25"
     android:text="@string/number2" />

 <Button
     android:id="@+id/button3"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:text="@string/number3"
     android:layout_weight="1.25" />

 <Button
     android:id="@+id/buttonPlus"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_weight="1.25"
     android:text="@string/calcAddition" />

</LinearLayout>
 <LinearLayout 
android:id="@+id/linearLayout4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

     <Button
         android:id="@+id/button4"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number4"
         android:layout_weight="1.25" />

     <Button
         android:id="@+id/button5"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number5" 
         android:layout_weight="1.25"/>

     <Button
         android:id="@+id/button6"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number6"
         android:layout_weight="1.25"/>

     <Button
         android:id="@+id/buttonMinus"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1.25"
         android:text="@string/calcMinus" />

</LinearLayout>
 <LinearLayout 
android:id="@+id/linearLayout5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

     <Button
         android:id="@+id/button7"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number7"
         android:layout_weight="1.25" />

     <Button
         android:id="@+id/button8"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number8" 
         android:layout_weight="1.25"/>

     <Button
         android:id="@+id/button9"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/number9" 
         android:layout_weight="1.25"/>

     <Button
         android:id="@+id/buttonMultiplication"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1.25"
         android:text="@string/calcMultiplication" />

</LinearLayout>
<LinearLayout 
android:id="@+id/linearLayout6"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

     <Button
         android:id="@+id/button0"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1.02"
         android:text="@string/number0" />

     <Button
         android:id="@+id/buttonCLR"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="0.67"
         android:text="@string/calcCLR" />

     <Button
         android:id="@+id/btnCalcEqual"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/calcEqual" />

     <Button
         android:id="@+id/buttonDivision"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1.1"
         android:text="@string/calcDiv" />

</LinearLayout>


</LinearLayout>

strings.xml:

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

<string name="app_name">Calculator</string>
<string name="number1">1</string>
<string name="number2">2</string>
<string name="number3">3</string>
<string name="number4">4</string>
<string name="number5">5</string>
<string name="number6">6</string>
<string name="number7">7</string>
<string name="number8">8</string>
<string name="number9">9</string>
<string name="number0">0</string>
<string name="calcCLR">CLR</string>
<string name="calcDiv">/</string>
<string name="calcMultiplication">*</string>
<string name="calcAddition">+</string>
<string name="calcMinus">-</string>
<string name="result">0</string>
<string name="calcEqual">Calculate</string>

</resources>
  • 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-31T06:11:22+00:00Added an answer on May 31, 2026 at 6:11 am

    If that is the entire xml layout then you must add on the first line this(before anything):

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

    Also this:

    xmlns:android="http://schemas.android.com/apk/res/android"
    

    is only required only on the first element in the layout(in your case the LinearLayout with the id linearLayout1).

    Edit:

    On your EditText you set the color: android:textColor="@layout/main",this is wrong. If you want a color resource then do this:

    android:textColor="@color/the_color"
    

    where the_color is a color set in your colors.xml file in the values folder containing:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <color name="the_color">#0077cc</color>
    
    </resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm am creating an Android application, but in order to have one of the
I am developing an application in android in which i creating a list view
I am creating an simple android application in that created a notification. Now i
I am creating a simple application in Android. When I compile and run it
I am creating an android application which has to execute web requests in the
I'm creating my first android application but it does not start at all. In
I am creating an android application in which the user can view the channel
I am following a tutorial for creating a simple application in Android , and
I am creating an android application in which there are two activites. One activity
i am creating simple call filter application which restrict unwanted calls. i use following

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.