0

I am trying to build an apk file using android studio, and facing duplicated resources error

I have tried to delete some of duplicates but with no luck

[drawable-xhdpi-v4/assets_images_ic_share] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_share.png    [drawable-xhdpi-v4/assets_images_ic_share] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_share.png: Error: Duplicate resources
[drawable-xhdpi-v4/node_modules_reactnativedropdownalert_assets_error] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativedropdownalert_assets_error.png    [drawable-xhdpi-v4/node_modules_reactnativedropdownalert_assets_error] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/node_modules_reactnativedropdownalert_assets_error.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_favorite] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_favorite.png  [drawable-xhdpi-v4/assets_images_ic_favorite] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_favorite.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_favorited] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_favorited.png    [drawable-xhdpi-v4/assets_images_ic_favorited] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_favorited.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_success] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_success.png    [drawable-xhdpi-v4/assets_images_ic_success] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_success.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_comment] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_comment.png    [drawable-xhdpi-v4/assets_images_ic_comment] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_comment.png: Error: Duplicate resources
[drawable-xhdpi-v4/node_modules_reactnativedropdownalert_assets_info] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativedropdownalert_assets_info.png  [drawable-xhdpi-v4/node_modules_reactnativedropdownalert_assets_info] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/node_modules_reactnativedropdownalert_assets_info.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_add_comment] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_add_comment.png    [drawable-xhdpi-v4/assets_images_ic_add_comment] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_add_comment.png: Error: Duplicate resources
[drawable-xhdpi-v4/assets_images_ic_white_more] /Users/hadi/Desktop/lancer/beonews/android/app/src/main/res/drawable-xhdpi/assets_images_ic_white_more.png  [drawable-xhdpi-v4/assets_images_ic_white_more] /Users/hadi/Desktop/lancer/beonews/android/app/build/generated/res/react/release/drawable-xhdpi/assets_images_ic_white_more.png: Error: Duplicate resources
ADM
  • 20,406
  • 11
  • 52
  • 83
KHUSER
  • 61
  • 7
  • have you added external libraries/modules to your project? – Badran Apr 24 '19 at 09:01
  • I am using expo project, so yes I did – KHUSER Apr 24 '19 at 09:05
  • then please double check the resources of the expo project and your project if they contain the same resources names, this is a bug in Android studio and I think it's reported. – Badran Apr 24 '19 at 09:15
  • I've tried to delete the duplicates but when I build again android studio generated them again and makes same error ! should I rename the expo resources? but I think android studio will generate them as well ! – KHUSER Apr 24 '19 at 09:25
  • I meant that you have to check for duplicates between expo project and your project and if there is any you have to rename them – Badran Apr 24 '19 at 09:27
  • Here is the simple solution : https://stackoverflow.com/a/55245362 work for me , happy coding – Agus tri May 30 '19 at 06:53

0 Answers0