2017-02-08 43 views
0

我是新来的android和我有这个错误,我一直在寻找解决方案,并且仍然不知道如何解决这个问题。我有这样的:任务':app:mergeDebugResources'的执行失败。 > -1

Error:Execution failed for task ':app:mergeDebugResources'.> -1

,效果是我每天的活动得到了[R“不能解析符号R”

我一直在试图清理,建立和同步与gradle这个,但仍然没有工作..

这是我的资源: 的strings.xml

<resources> 
    <string name="app_name">mLibrary AeU</string> 
    <string name="action_search">action_search</string> 
    <string name="search_hint">search_hint</string> 
    <string name="welcome">welcome</string> 
    <string name="btn_logout">btn_logout</string> 
</resources> 

colors.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <color name="colorPrimary">#2f2d79</color> 
    <color name="colorPrimaryDark">#303F9F</color> 
    <color name="colorAccent">#FF4081</color> 

    <color name="callNumber">#666666</color> 
    <color name="author_and_year">#888888</color> 
    <color name="list_divider">#d9d9d9</color> 
    <color name="list_row_start_color">#ffffff</color> 
    <color name="list_row_end_color">#ffffff</color> 
    <color name="list_row_hover_start_color">#ebeef0</color> 
    <color name="list_row_hover_end_color">#ebeef0</color> 
</resources> 

dimens.xml

<?xml version="1.0" encoding="utf-8"?> 
<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="title">17dp</dimen> 
    <dimen name="author">15dip</dimen> 
    <dimen name="callNumber">13dip</dimen> 
    <dimen name="year">13dip</dimen> 
</resources> 

styles.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <!-- Base application theme. --> 
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <!-- Customize your theme here. --> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 

</resources> 

我需要你的帮助。

+0

'无法解析符号R'通常意味着您的某个资源文件中有错误。即布局或样式等 – Kuffs

+0

尝试清理您的项目并再次运行。 –

+0

您能否通过您的“gradle console”选项卡提供与此相关的日志? –

回答

0

你应该检查你的资源文件和AndroidManifest文件。它可能与图像资源有关(它们应该是.png文件,它们的名称必须是小写)。这一定是一个小错误。

0

问题解决了!谢谢你们的推荐。问题是在我的资产文件夹中仍然有一个库文件夹

相关问题