2016-12-07 111 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

相關問題