Reputation: 507
i have a project that i wrote, when i finished it it was fine code worked no errors. One day i open up Eclipse and i have three errors, one each in three of of my layouts.
two cases of:
Error Integer Type not allowed at 'padding'
This error was for the code:
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp" > # line the error is on
the above is the same in two different layouts and the code bellow was is the third:
<TextView
android:id="@+id/finalBillTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content" #line the error is on
android:layout_span="2"
android:layout_weight="1"
android:text="@string/total_bill_TV" />
with an error of:
Error parsing XML: duplicate attribute
I dont understand how i am doing anything wrong. Any where else in the code that use '5dp' or similar it is fine. if if delete the code and retype the errors all go away, and wont return till i reload eclipse.
i have tried creating the value in dimens.xml file in values folder and referencing it with @dimen/ but this did not work ether and i dont understand the duplacate value at all. would this be an eclipse error maybe?
Upvotes: 1
Views: 4086
Reputation: 1
first delete the error making lines and clean the project untill all errors are gone. then re-ad the same property . do not forget to type 5dip correctly this time . it should be 5dip
Upvotes: 0
Reputation: 254
android:padding="5pd" < it should be "5dp"
also about the duplicate attribute.. have you tried deleting it?.. I presume that its on a linear so its probably conflicting with :
android:layout_span="2"
Upvotes: 1
Reputation: 1209
If the typo part didn't fix it(just mis typed up above), then sometimes doing a "Clean Project" clears out the error if you are using Eclipse.
Upvotes: 1