2016-12-07 118 views
1

即使我没有选择photothumb.db的绘制,我得到一个错误说photothumb.db应.XML结束或.png错误:文件名必须以.XML结束或.png

我的profilesmaller图像的类型是png

下面是我的代码

<FrameLayout 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/profilesmaller" 
    tools:context="charlenebuena.guest.HomeFragment"> 
</FrameLayout> 

下面是我的摇篮控制台消息

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:mergeDebugResources'. 
> C:\Users\Charlene Marie\AndroidStudioProjects\Guest\app\src\main\res\drawable\photothumb.db: Error: The file name must end with .xml or .png 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 2.72 secs 
+1

将photothumb.db的位置从drawable改为资产文件夹,它将解决问题 – Nitesh

+0

@Char无论图片还是数据库文件,drawable中的图片文件名中是否带有jpg或png扩展名 – Vishwa

+0

? – Nitesh

回答

1

Android仅接受.png,.jpg,.gif和.xml文件作为可绘制资源。如果您有文件.db文件,然后将该文件放在资产文件夹中。

0

将photothumb.db文件从drawable移至资产目录。如果资产目录不存在,那么右键点击 main> New> directory> assets然后create.Place你的db文件在那里,你很好走。

-1

只需将您的图像文件扩展名从某物(如ico等)更改为png。 它会工作。

+0

这是一种解决方法,而不是解决方案或真正的解决方案 – fechnert

相关问题