Resource already defined gradle Android Studio

I have different image sizes in my available resource folders for different screen sizes. they are all splash_login.png splash_screen.png. In my catalog of large resource layouts, however, I have splash_login.jpg and splash_screen.jpg because the images are very large. Now when I try to start gradle build, I get the following error in the stack trace

build/intermediates/symbols/release
Error Code:1
Output:
res/drawable-large-v4/splash_login.png:0: error: Resource entry splash_login is    already defined.
res/drawable-large-v4/splash_login.jpg:0: Originally defined here.
res/drawable-large-v4/splash_screen.png:0: error: Resource entry splash_screen is already defined.
res/drawable-large-v4/splash_screen.jpg:0: Originally defined here.

I know this is because the file extension has changed, but does anyone know how to get around it without returning my large images to .png files?

Thank!

+4
source share
3 answers

Found the answer. Running the following command fixed this for me:

 gradle clean build assemble
+3

, ( .xml.xml .xml)

Android Studio:

>

+3

another option is to find the file in the folders of the build cache and rename / delete it there.

on my windows computer the problem file was in the [project directory] \ build \ res \ all \ debug \ raw 'directory

0
source

Source: https://habr.com/ru/post/1547478/


All Articles