2014-01-25 36 views
-3

1.没有发现与给定名称匹配的资源(在'padding'中值为'@ dimen/default_gap')。编译Android Studio 0.4.2中的代码时出错[:app:processDebugResources,资源未找到]

2.执行任务':app:processDebugResources'失败。

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\bujima\AppData\Local\Android\android-studio\sdk\build-tools\19.0.1\aapt.exe package -f --no-crunch -I C:\Users\bujima\AppData\Local\Android\android-studio\sdk\platforms\android-19\android.jar -M C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\res\all\debug -A C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\assets\debug -m -J C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\source\r\debug -F C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\libs\app-debug.ap_ --debug-mode --custom-package edu.asu.ecs.tel Error Code: 1 Output: C:\Users\bujima\AndroidStudioProjects\Musicplayer2\app\build\res\all\debug\layout\fragment_setting.xml:8: error: Error: No resource found that matches the given name (at 'padding' with value '@dimen/default_gap').

+0

有你定义了一个叫default_gap中值/ dimens.xml尺寸是多少?你的布局fragment_setting.xml正在使用它。 – pyus13

+0

<! - 默认屏幕边距,根据Android设计指南。 - > <扪名称= “activity_horizo​​ntal_margin”> 16DP <扪名称= “activity_vertical_margin”> 16DP <扪名称= “default_gap”/> Arut

+0

仍然显示误差作为 – Arut

回答

1

您不能在里面定义任何没有值的尺寸。

这是怎么了你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="default_gap" >your_value_here_in_dp</dimen> 

</resources>