I am trying to build my Android app and am recieving this error:
Error:Error: Duplicate resources: /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/src/main/res/values/dimens_orange.xml:dimen/tab_host_default_height, /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/src/main/res/values/dimens_finalbeertheme.xml:dimen/tab_host_default_height
And also this error:
Error:Execution failed for task ':BeerPprtfolio:mergeDebugResources'.
> /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/src/main/res/values/dimens_orange.xml: Error: Duplicate resources: /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/src/main/res/values/dimens_orange.xml:dimen/tab_host_default_height, /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/src/main/res/values/dimens_finalbeertheme.xml:dimen/tab_host_default_height
This is after trying to import a custom theme from Android Holo Colors.
You must eliminate one of dimen/tab_host_default_height in your dimens_orange.xml or dimens_finalbeertheme.xml, because they are duplicate.
Check your error "Error: Duplicate resources:"
Related
hi everyone hope everyone is well. i am new to flutter and while building my application for my final year project i came accross this issue..my application is working on ios emulator but when i plug it into my andriod phone i come across this issue please advise
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:/Users/Desktop/c3mobiredo/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:44: AAPT: error: resource mipmap/ic_launcher (aka com.example.c3mobiredo:mipmap/ic_launcher) not found.
ERROR:/Users/Desktop/c3mobiredo/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:50: AAPT: error: resource style/LaunchTheme (aka com.example.c3mobiredo:style/LaunchTheme) not found.
ERROR:/Users/Desktop/c3mobiredo/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:65: AAPT: error: resource style/NormalTheme (aka com.example.c3mobiredo:style/NormalTheme) not found.
please let me know if you need additional information from me
It's about files not being found. Does the android folder in your project have a structure like this?
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
hello i want to ask about android error message and i want to know how to solve this issue.
im develop it with react native, and i wanted to know what does it mean and how to solve it.
you can see the error here bellow
home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/588cc028d2e630da3036f4ad87f9dbb3/res/values/values.xml:252:5-69: AAPT: Attribute "aspectRatio" already defined with incompatible format.
home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.2.aar/588cc028d2e630da3036f4ad87f9dbb3/res/values/values.xml:252:5-69: AAPT: Original attribute defined here.
project/node_modules/react-native-camera/android/build/intermediates/bundles/debug/res/values/values.xml:20:5-26:13: AAPT: String types not allowed (at 'aspectRatio' with value '4:3').
warning: string 'title_payment_failed' has no default translation.
Failed to generate resource table for split ''
project/android/app/build/intermediates/res/merged/debug/values/values.xml:477: error: Attribute "aspectRatio" already defined with incompatible format.
project/android/app/build/intermediates/res/merged/debug/values/values.xml:462: Original attribute defined here.
project/HGC-datacomm/android/app/build/intermediates/res/merged/debug/values/values.xml:3636: error: Error: String types not allowed (at 'aspectRatio' with value '4:3').
> Task :app:processDebugResources FAILED
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
thanks in advance
PS. i'm already set android.enableAapt2 into false
edit : i've found how to reproduce this error
compile ('com.midtrans:uikit:1.20.3-PRODUCTION')
compile ('com.midtrans:uikit:1.20.3')
compile project(':react-native-camera')
// midtrans repositories
maven { url "http://dl.bintray.com/pt-midtrans/maven" }
maven { url "https://jitpack.io" }
im suspecting there is a conflict about the dependencies,because when im comment one of the package its working without an issue but i don't know how to solve it. perhaps veteran android can help me how to solve it ?
thanks in advance
So, I was doing some modification on my code this morning and it runs just like it used to. And then when I tried to run react-native run-android again after few hours, I got below error:
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_title_item.xml:21:22-76: AAPT: No resource found that matches the given name (at 'style' with value '#style/RtlOverlay.Widget.AppCompat.ActionBar.TitleItem').
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_title_item.xml:30:41-91: AAPT: No resource found that matches the given name (at 'layout_marginTop' with value '#dimen/abc_action_bar_subtitle_top_margin_material').
/Users/mimicreative/Documents/Kerja/Project/PictalogiDev/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/res/layout/abc_action_bar_view_list_nav_layout.xml:22:22-48: AAPT: No resource found that matches the given name (at 'style' with value '?attr/actionBarTabBarStyle').
So much line of error like above then at the end of the line I got this:
Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
How can I fix this? What causes the error?
For anyone having this issue, you just need to update the Android Support Repository using Android SDK Manager.
My project was compiling fine until I deleted some png drawables and replaced them with vector drawables by navigating to New > Vector Asset. I am now getting a duplicate resources error.
Here is my res folder:
Here is the error message in the Gradle console:
Execution failed for task ':app:mergeDebugResources'.
> [drawable/ic_menu_manage] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_manage.xml [drawable/ic_menu_manage] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
[drawable/ic_menu_share] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_share.xml [drawable/ic_menu_share] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
[drawable/ic_menu_slideshow] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_slideshow.xml [drawable/ic_menu_slideshow] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
[drawable/ic_menu_send] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_send.xml [drawable/ic_menu_send] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
[drawable/ic_menu_gallery] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_gallery.xml [drawable/ic_menu_gallery] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
[drawable/ic_menu_camera] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/drawable/ic_menu_camera.xml [drawable/ic_menu_camera] /Users/tomfinet/AndroidStudioProjects/Birthpay/app/src/main/res/values/drawables.xml: Error: Duplicate resources
How do I fix this and why is it happening?
The error suggests that the drawable.xml file is responsible for the error. So I opened it and commented out the xml code and the app ran fine. I have no idea why this fixes it but this solved the problem.
when we add some new thing in out project, in that case some times resources might get duplicate that time it will give the error while run the app, in my case also get same issue I had face, while I had added the kotlin activity in java project, in it gives me error
Execution failed for task ':app:mergeDebugResources'. ...\themes.xml: Error: Duplicate resources
so in this case please check the local history and remove the duplicate resources from res folder, so simply revert that changes
To revert changes click on res folder and go to local history and check the duplicate file name and revert that changes which was not present in running code
in my case there was \themes.xml file is added newly so I reverted that changes and run code, it run successfully