重复的错误 - noob程序员

时间:2014-10-10 02:52:45

标签: android android-studio code-duplication

这是我的代码,我不知道它有什么问题我是全新的,如果我能收到一些反馈意见,我会非常感激:)当我尝试启动我的应用程序时模拟器告诉我,由于这些错误,我无法做到:

  1.   

    错误:错误:资源重复:   C:\ Users \用户鉴\ AndroidStudioProjects \ SchoolAid5 \应用\ SRC \主\ RES \布局ldltr-V14 \ activity_my.xml:布局ldltr-V17 / activity_my,   C:\ Users \用户鉴\ AndroidStudioProjects \ SchoolAid5 \应用\ SRC \主\ RES \布局ldltr \ activity_my.xml:布局ldltr-V17 / activity_my

  2.   
  3.   

    错误:任务':app:mergeDebugResources'执行失败。   C:\ Users \ Kam \ AndroidStudioProjects \ SchoolAid5 \ app \ src \ main \ res \ layout-ldltr-v14 \ activity_my.xml:错误:重复资源:C:\ Users \ Kam \ AndroidStudioProjects \ SchoolAid5 \ app \ src \ main \ res \ layout-ldltr-v14 \ activity_my.xml:layout-ldltr-v17 / activity_my,C:\ Users \ Kam \ AndroidStudioProjects \ SchoolAid5 \ app \ src \ main \ res \ layout-ldltr \ activity_my.xml:layout- ldltr-V17 / activity_my

  4.      这是我的代码,其中的错误是:

    `

    <GridLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/gridlayout"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">
    
            <Button
                android:layout_width="match_parent"
                android:layout_height="100dp"
                android:id="@+id/button1classes"
                android:layout_row="0"
                android:layout_column="0"
                android:textAlignment="textStart"
                android:textSize="25sp"
                android:textColor="#ffffffff"
                android:text="@string/classes"
                android:width="150dp"
                android:onClick="onOpenclasses_screen"/>
    
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/homework"
                android:id="@+id/button2homework"
                android:layout_row="1"
                android:layout_column="0"
                android:clickable="true"
                android:width="150dp"
                android:height="100dp"
                android:textSize="25sp"
                android:textAlignment="textStart"
                android:textColor="#ffffffff" />
    
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/notes"
                android:id="@+id/button3notes"
                android:layout_row="2"
                android:layout_column="0"
                android:clickable="true"
                android:height="100dp"
                android:textColor="#ffffffff"
                android:textSize="25sp"
                android:width="150dp" />
    
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/calendar"
                android:id="@+id/button2calendar"
                android:layout_row="3"
                android:layout_column="0"
                android:clickable="true"
                android:height="100dp"
                android:textColor="#ffffffff"
                android:textSize="25sp"
                android:width="125dp" />
    
            <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/share"
                android:id="@+id/button3share"
                android:layout_row="4"
                android:layout_column="0"
                android:clickable="true"
                android:height="100dp"
                android:textColor="#ffffffff"
                android:textSize="25sp"
                 />
        </GridLayout>
    </LinearLayout>
    

    请记住,我是一个完整的菜鸟,只是想为项目构建应用程序。我真的可以帮助我和我的项目的未来。再次感谢抱歉这篇长篇文章。

1 个答案:

答案 0 :(得分:0)

看起来您可能有重复的activity_my.xml文件。确保给定设备只能访问一个文件。如果您只想使用一个布局定位所有设备。只需将所有布局放在res / layout /中,然后删除更深层次的布局目录。