2015-02-06 120 views
0

我有一个很大的控制台,里面充满了错误,所有相同的错误。“没有发现与给定名称匹配的资源”

[2015-02-07 08:33:42 - TheHunter] C:\Users\Windows 8\workspace\TheHunter\res\drawable-hdpi\custom2.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/button2'). 

[2015-02-07 08:33:42 - TheHunter] C:\Users\Windows 8\workspace\TheHunter\res\drawable-hdpi\custom3.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/button3'). 

我有这些相同的错误,但在我的控制台大约100次不同的图像。 这只是我的主页的代码的一点点,我有几个按钮和图像正在使用,但保持所有相同的错误。由于这些错误,我看到它只是不允许我在android模拟器中使用应用程序的所有图像。

请问您为什么会收到这些错误?谢谢。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/background" 
    tools:context="com.application.thehunter.MainActivity" > 

    <ImageButton 
     android:id="@+id/imageButton1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:layout_marginTop="74dp" 
     android:contentDescription="TODO" 
     android:background="@drawable/custom1" 
     android:src="@drawable/Button1" 
     tools:ignore="HardcodedText,ContentDescription" /> 

    <ImageButton 
     android:id="@+id/imageButton2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/imageButton1" 
     android:contentDescription="TODO" 
     android:background="@drawable/custom2" 
     android:src="@drawable/Button2" 
     tools:ignore="HardcodedText,ContentDescription" /> 

回答

1

资本是问题的一部分。资源名称必须是以字母开头的小写字母,数字或下划线。再仔细检查一下,你是否确实有文件命名。

相关问题