无法为拆分''生成资源表

时间:2015-01-29 21:33:39

标签: android

我正在尝试创建一个Android应用程序。目前它不会运行,它会给我2个错误。

enter image description here

我不确定如何让第一个错误消失以及第二个错误消失。当我检查控制台时,这就是我得到的。

[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

我不确定这意味着什么,并且找不到有效解决方案的原因。我试图清理/重建,但仍然没有帮助。谢谢。

这是dimens.xml文件:

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

1 个答案:

答案 0 :(得分:5)

你有一个拼写错误,你使用字符串值来声明边距。

  

错误:不允许使用字符串类型(在&#39; textview_margin8dp&#39;值为&#39; textview_margin 8dp&#39;)

下面:

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

应该是:

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