Android Studio:代码有重复资源错误,如何修复?
我刚开始学习Android Studio。我正在开发一个生日卡应用程序。 这是我的代码:Android Studio:代码有重复资源错误,如何修复?,android,xml,Android,Xml,我刚开始学习Android Studio。我正在开发一个生日卡应用程序。 这是我的代码: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
<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"
tools:context=".MainActivity">
<TextView
android:text="Happy Birthday,Seetha Hari!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"/>
<TextView
android:text="From, Srinitya Suripeddi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
<ImageView
android:id="@+id/birthday"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src ="@drawable/birthday" />
</RelativeLayout>
运行应用程序时出现重复资源错误
请帮忙。
我的操作系统是Ubuntu。我不知道这是否有什么区别,它说你有两个
生日资源。一个jpg和一个XML。所以它失败了,因为它不知道该用什么
删除未使用的或重命名的;如果您打算使用SVG,则最有可能是jpg,因为XML将是SVG的形状向量导入。看一看->您的可绘制文件夹名为birthday.jpg中有一个同名文件
请删除1并重试
完整路径是->res/drawable/birth.jpg成功了!谢谢…您的可绘图文件夹名为birthday.jpg中有一个同名文件,请删除一个并重试
AGPBI: {"kind":"error","text":"Duplicate resources","sources":[{"file":{"description":"drawable/birthday","path":"/home/hse/AndroidStudioProjects/HappieBirthday/app/src/main/res/drawable/birthday.jpg"}},{"file":{"description":"drawable/birthday","path":"/home/hse/AndroidStudioProjects/HappieBirthday/app/src/main/res/drawable/birthday.xml"}}],"tool":"Resource and asset merger"}
Execution failed for task ':app:mergeDebugResources'.
> [drawable/birthday] /home/hse/AndroidStudioProjects/HappieBirthday/app/src/main/res/drawable/birthday.jpg [drawable/birthday] /home/hse/AndroidStudioProjects/HappieBirthday/app/src/main/res/drawable/birthday.xml: Error: Duplicate resources