When I am trying to generate android apk by using ./gradlew installRelease
, I get this error in console:
~/React-Native/mockingbird/android/app/
A way to remove the error would be to:
However, this is not an ideal solution because each image will only have one resolution for all device sizes. For images that are too big for a device it leaves downscaling to the device and leads to download size and speed issues, and for images too small for a device it leads to diminished image quality.
One convenient solution I’ve found is to use an Android Studio plugin called Android Drawable Importer. To use it after it is installed:
The plugin will handle the generation of the drawable folders and correct image sizes. Once you’ve imported your image, you should be able to run Gradle’s assembleRelease without the duplicate resources error.