2

I am trying to create an Android application. Currently it won't run and it will give me 2 errors.

enter image description here

I am unsure on how to get the first error to go away as well as the second one. When I check the console this is what I get.

[2015-01-29 16:16:48 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:16:48 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:16:48 - TipCalculator] 
[2015-01-29 16:17:04 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:17:04 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:17:04 - TipCalculator] 
[2015-01-29 16:18:05 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:18:05 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:18:05 - TipCalculator] 
[2015-01-29 16:26:28 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:26:28 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:26:28 - TipCalculator] 
[2015-01-29 16:26:46 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:26:46 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:26:46 - TipCalculator] 
[2015-01-29 16:27:49 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:27:49 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:27:49 - TipCalculator] 
[2015-01-29 16:28:11 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:28:11 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:28:11 - TipCalculator] 
[2015-01-29 16:29:32 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:29:32 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:29:32 - TipCalculator] 
[2015-01-29 16:29:51 - TipCalculator] Failed to generate resource table for split ''
[2015-01-29 16:29:51 - TipCalculator] /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:7: error: Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp').
[2015-01-29 16:29:51 - TipCalculator] 
[2015-01-29 16:29:51 - TipCalculator] Dx 
trouble writing output: already prepared

I am unsure on what this means and can not find a valid solution on why this is happening. I tried to Clean/Rebuild and that still hasn't help. Thank you.

Here is the dimens.xml file:

<resources>

    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="textview_padding">8dp</dimen>
    <dimen name="textview_margin8dp">textview_margin 8dp</dimen>
    <dimen name="textview_margin">8db</dimen>

</resources>
Lewis Menelaws
  • 1,186
  • 5
  • 20
  • 42
  • @user3956566 Here is the dimens.xml file. I just posted it to my main post. – Lewis Menelaws Jan 29 '15 at 21:39
  • `String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp')` what else can you possibly need? – njzk2 Jan 29 '15 at 21:44
  • @njzk2 I am not familiar with Eclipse. I am asking a question because I don't understand. – Lewis Menelaws Jan 29 '15 at 21:47
  • it says you are declaring a thing that is named `textview_margin8dp`, which has a value `textview_margin 8dp`, and that value is a type `String`, which is not allowed. Now, by comparing that value with the ones immediately surrounding it, you should notice a difference in the format. (Also, this has nothing to do with Eclipse.) – njzk2 Jan 29 '15 at 21:51

1 Answers1

5

You have a typo, you are using a String value to declare the margin.

Error: String types not allowed (at 'textview_margin8dp' with value 'textview_margin 8dp')

Here:

<dimen name="textview_margin8dp">textview_margin 8dp</dimen>

It should be:

<dimen name="textview_margin8dp">8dp</dimen>
  • This fixed the issue on that line. Now it gives me an error on the very next line /Users/lewismenelaws/Documents/workspace/TipCalculator/res/values/dimens.xml:8: error: Error: String types not allowed (at 'textview_margin' with value '8db'). – Lewis Menelaws Jan 29 '15 at 21:44
  • 1
    `8db`. What would you think that does? – njzk2 Jan 29 '15 at 21:51