9

Even though I didn't choose photothumb.db as a drawable, I get an error saying photothumb.db should end with .xml or .png

my profilesmaller image is of type png

Below are my codes

<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>

Below is my Gradle Console Message

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
Surya Prakash Kushawah
  • 3,185
  • 1
  • 22
  • 42
Char
  • 2,073
  • 8
  • 28
  • 45

6 Answers6

15

Android accepts only .png, .jpg, .gif and .xml files as drawable resources. If you have file .db file then put that file in assets folder.

Dhanveer thakur
  • 902
  • 1
  • 9
  • 17
3

I had a similar problem after I converted .png icons to .webp format. The file was created in the xxhdpi folder and not used. I didn't remember creating or using photothumbs.db in any of my app's xml and java files. The error was cleared after simply deleting the photothumbs.db file. Create a backup copy of the file anyway for safety before deleting it.

1

Remove photothumb.db file from drawable to asset directory. If asset directory is not there then right click on main > New > directory > assets and then create.Place your db file there and you are good to go.

Nitesh
  • 318
  • 3
  • 16
0

This happened to me when somehow (I have no idea how) one of my asset files got ended up in

.../app/src/main/res/assets/model.tflite 

When it should have been at

.../app/src/main/assets/model.tflite

Moving it back fixed the problem.

Peter
  • 12,274
  • 9
  • 71
  • 86
0

just check if there are weird directory names under in /app/src/main/res/

$ ls drawable mipmap-hdpi drawable-hdpi mipmap-mdpi drawable-ldpi mipmap-xhdpi drawable-mdpi mipmap-xxhdpi drawable-xhdpi mipmap-xxxhdpi drawable-xxhdpi raw drawable-xxxhdpi rawwhilemusic.mp3 winner.mp3 <- (after deleting this directory no error) layout values mipmap-anydpi-v26

rabie jegham
  • 125
  • 2
  • 3
-2

Just change your image file extension from something(like ico etc) to png. It will work.