Duplicate value for resource 'attr/pivotX' with config ' '

Viewed 3492

After a month, launched Android studio and on syncing with Gradle, this error pops up. Rebuilding/cleaning the project does not works and shows the same error again.

I have tried to rebuilding/clean and invalidate/restart the project but nothing seems to be working. I have searched out on this site about the problem but yet again nothing seems to be working. Would be really great if someone helps me with this one because I am stuck and can`t provide update my app.

Android resource compilation failed Output: E:\Play Store Listings\Notepedia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2616: error: duplicate value for resource 'attr/pivotX' with config ''.

E:\Play Store Listings\Notepedia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2616: error: resource previously defined here. E:\Play Store Listings\Notepedia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2616: error: duplicate value for resource 'attr/pivotY' with config ''. E:\Play Store Listings\Notepedia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2616: error: resource previously defined here.

Command: C:\Users\Taseer.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\8dd90688e4f5a22b34a1a148f45c2455\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \ -o \ E:\Play Store Listings\Notepedia\app\build\intermediates\res\merged\debug \ E:\Play Store Listings\Notepedia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

EDIT: This is where the error leads to: Image

EDIT 2: Link to download(File removed)

4 Answers

In my case I tried to implement new versiont of Constraint Layout(in gradle)

implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'

and I get this error. I dont want to edit any attribes, I do revert to stable version

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

And the error dessapears.

That helped me.

  1. Find library that cause that conflict (just remove libraries dependencies one by one and sync gradle).
  2. Go to External Libraries > "conflict library" > res > values
  3. Open values.xml and find there an attribute with the conflict name (in that case it's 'pivotX') and refactor that name to any other.

I had this same issue and had to look through the beta changes. Found the problem has been fixed in beta8

implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'

For future reference, I am posting the comment as anwer

pivot is already defined as view attribute. that might be the reason you are having this issue. try prefixing some label may be like transformPivotX and this might work. Do this for all the attribute you have in image shared.

Related