Lewis Lewis - 2 months ago 33
Android Question

Failed to generate resource table for split ''

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>

Answer

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>
Comments