Resource error pease tell me how to solve - android

Android resource linking failed
C:\Users\Afraz\Desktop\Summaira
FYP\PHMS\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2103:
error: resource android:attr/foregroundInsidePadding is private.
C:\Users\Afraz\Desktop\Summaira
FYP\PHMS\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2433:
error: resource android:attr/popupPromptView is private. error: failed
linking references.

Just don't use android:attr/foregroundInsidePadding and android:attr/popupPromptView. They would be public if they were meant to be used.

I have coincided this error couple of times before so I recommend you to delete your .idea file and then apply invalidate cashes and restart in AS. You will get rid of this error after that

Related

How can I resolve the Android Studio Build Output error

Trying to build the app but have got the error: The error Confugure image asset1
Confugure image asset2
Confugure image asset3
ERROR:C:\Users\Alex\AndroidStudioProjects\Lm2\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: AAPT: error: resource mipmap/ic_launcher_background (aka com.example.lm2:mipmap/ic_launcher_background) not found.
How can I resolve this?
I hope you have
put your launcher icons into the mipmap folder where they should always go.
added your adaptive icon to the app’s manifest.xml for “android:icon” (android:roundIcon) attribute
.
Fist hand try: Clean your project and Rebuild
Probable Issue reason: Malformed XML:
Solution:
Check if you have anything duplicated by mistake in your XML
Try Analyze > Inspect Code it will redirect you to the exact error.

Android preference defautvalue duplicate resource

I want to make a settings activity for an android app. I used the standard activity for the settings but I keep getting the error:
\.gradle\caches\transforms-2\files-2.1\e3ce7e7cf0568bf54350349961cc10db\preference-1.1.1\res\values\values.xml:257:5-336:25: AAPT: error: duplicate value for resource 'attr/defaultValue' with config ''.
I think it has something to do with the androidx.preference.PreferenceFragmentCompat because the error disappears when I remove the dependency on android.preference:preference:1.1.1. Do you know how to fix this?
I figured it out. The DevaultValue was already defined by me in the res/attr/ folder. deleting this value makes it work.
If you already have a field with defaultValue in attrs file, rename it and try rebuild it. It works

"AAPT: error: resource not found" when I'm testing

I've written an instrumented test. When I run it I get an error:
/Users/ilamasin/StudioProjects/ecwid/general/build/intermediates/packaged_res/debug/drawable/horizontal_divider_with_padding.xml:6:
AAPT: error: resource dimen/horizontal_divider_thickness (aka
com.ecwid.android.reports.test:dimen/horizontal_divider_thickness) not
found.
It's my drawable in project and it exists. My project runs and works. But test doesn't. Did anyone has this error? I use Junit and Mockito (Sorry for my English)
just go to dimen file and add value to this-:
res->values->dimen and give value to dimen/horizontal_divider_thickness
or go to drawable file and pass value i.e 15dp or 20dp whatever you want to add.

resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found

When I want to try the application on the emulator or extract the .apk
I face this error
Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
error: failed linking references.
I think your are applying that style wrong.
Try to set the style of your view in your layout (.xml file) this way:
style="#style/TextAppearance.Material.Widget.Button.Borderless.Colored"
Let me know if that helped!

Android duplicate resources error

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

Categories

Resources