Android Studio Gradle Build错误:不允许字符串类型(在' activity_horizo​​ntal_margin'值为'')

时间:2017-10-16 00:48:03

标签: android gradle

刚下载Android Studio。跟着this教程逐字。尝试" Build"时继续遇到以下错误,我不知道如何通过它。

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
C:\Users\SV\AndroidStudioProjects\ToDoApp\app\build\intermediates\res\merged\debug\values\values.xml
Error:(872, 69) String types not allowed (at 'activity_horizontal_margin' with value '').
Error:(872, 69) String types not allowed (at 'activity_horizontal_margin' with value '').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 1.429 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console

1 个答案:

答案 0 :(得分:0)

如果您还没有values文件夹,请在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> </resources> 的文件。然后在其中添加以下代码:

sorted