簡體   English   中英

Android Studio Gradle 構建錯誤:不允許字符串類型(在 'activity_horizo​​ntal_margin' 處,值為 '')

[英]Android Studio Gradle Build Error: String types not allowed (at 'activity_horizontal_margin' with value '')

剛剛下載了Android Studio。 逐字遵循教程。 嘗試“構建”時不斷遇到以下錯誤,我不知道如何克服它。

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

如果您還沒有,請在您的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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM