EAS Build Android Error - Duplicate resources

Hi Expo

We build our expo project with eas, with ios it oke
But android we had errors, and we don’t know how to find and fix.

Thanks

> Task :react-native-webview:packageReleaseResources
> Task :app:mergeReleaseResources FAILED
[stderr] [drawable-mdpi-v4/src_assets_noimage] /home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/src_assets_noimage.jpg [drawable-mdpi-v4/src_assets_noimage] /home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/src_assets_noimage.png: Resource and asset merger: Duplicate resources
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > [drawable-mdpi-v4/src_assets_noimage] /home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/src_assets_noimage.jpg	[drawable-mdpi-v4/src_assets_noimage] /home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/src_assets_noimage.png: Error: Duplicate resources
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 5m 5s

Weird.

Somehow there is a file called src_assets_noimage.jpg and in addition there’s one called src_assets_noimage.png. Off hand I don’t know where these would be coming from.

Maybe see if you can find them in your node_modules. e.g. if you’re running macOS or Linux:

% find node_modules -type f -name 'src_assets_noimage.[jp][pn]g' -print

Also, do you have an android directory in the root of your project? If so, do you have these files in there?

Our source has two asset file below
no-image.png
noImage.jpg
Root cause here, and we don’t know :sweat_smile:

Thanks for your support

1 Like