i'm trying to build an Android app referencing the androidx.legacy:legacy-support-v13 package, and unfortunately the AAPT2 link phase always fails for me with these three errors:
values.xml, line 4 — aapt2 link: resource 'color/primary_text_default_material_dark' has a conflicting value for configuration ().
values.xml, line 5 — aapt2 link: resource 'color/secondary_text_default_material_dark' has a conflicting value for configuration ().
values.xml, line 7 — aapt2 link: resource 'integer/cancel_button_image_alpha' has a conflicting value for configuration ().
these values are indeed duplicated, from resources in appcompat-1.4.1 and media-1.5.0
I'm not referencing either of these directly, but legacy-support-v13 pulls in appcompat-1.4.1, and that one in turn pulls in media-1.5.0, si i am assuming these two packages are supposed to be ab le to co-exist.
What could i be missing here?
ps: i am using my own build chain, cunning aapt2 compile and aapt2 link manually...
thanx!
Related
Severity Code Description Project File Line Suppression State
Error Unknown option -IC:\Program Files (x86)\Android\android-sdk\platforms\android-28\android.jar. Please check $(AndroidAapt2CompileExtraArgs) and $(AndroidAapt2LinkExtraArgs) to see if they include any aapt command line arguments that are no longer valid for aapt2 and ensure that all other arguments are valid for aapt2. Login.Android
Here is a document that described this problem:
Issue:
The new Android aapt2 resource tool has different commandline
arguments to the older aapt tool. These are generally incompatible
with each other.
Solution:
If you are receiving this error, check that the values provided in
<AndroidAapt2LinkExtraArgs/>
<AndroidAapt2CompileExtraArgs>
are valid for aapt2. You can use aapt2 compile and aapt2 link to view the list of valid arguments.
Your APK cannot be analyzed using aapt. Error output:
Failed to run aapt dump badging:
W/ResourceType(369737): No known package when getting value for resource number 0x7f0a0000
AndroidManifest.xml:37: error: ERROR getting 'android:icon' attribute: attribute value reference does not exist
bizarrely, my android manifest is not 37 lines long, but it does have android:icon.
I haven't changed anything in the android native layer recently - I've made changes to react native js code, and ran through my same deployment process of generate signed build to get an APK.
This is a new error and I am confused why it's happening and what it means.
The accepted answer for this related question: Android - Failed to run aapt dump badging: 'android:icon' attribute: attribute value reference does not exist has negative points and does not make sense to me.
The two higher suggested related questions did not have accepted answers.
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)
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.
Find library that cause that conflict (just remove libraries dependencies one by one and sync gradle).
Go to External Libraries > "conflict library" > res > values
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.
I have an app which I'm trying to compile with my original package name, very similar to this: com.mypackage.name_.app'
The app compiled successfully until now, which I migrated to the newest versions of Gradle and I'm compiling with API 24. Previously I used old versions of Gradle and API 23.
Now, when trying to compile that app, I'm getting this error:
APT: error: attribute 'package' in tag is not a valid Java package name: 'com.mypackage.name_.app'.
.
.
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
.
.
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
I found here that AAPT2 doesn't allow underscore in the end of a portion of your package name: All of my android studio projects and all new ones give me errors coming from the debug android manifest file
But then, what happens if you previously compiled and released into Google Play an app with a underscore in the end of a part of your package name? For example I found this example: https://play.google.com/store/apps/details?id=com.mobincube.tarifas_taxi_.sc_35K1XV
It is released into Google Play with this package name portion ".tarifas_taxi_."
How can that developer (and me) compile now our apps with underscore in that position?
AAPT2 does not allow package names with 'words' ending or starting with the underscore character.
Here for the package "com.mypackage.name_.app" the offending word is "name_". Remove the underscore or use "name_foo" (underscores are allowed in the middle of the word) to make is work.
There's an open issue on the issue tracker for this, it's being looked at by the AAPT2's owner.
More info: https://issuetracker.google.com/68468089
This question already has answers here:
Duplicate value for resource 'attr/font' with config "
(14 answers)
Closed 3 years ago.
I am trying to create circular-shaped buttons for my first android app.
For that, I added the library as
compile 'com.cuboid:cuboidcirclebutton:1.0.5' in circlebutton/app/build.gradle
As I sync, I get errors. below is the log
Information:Gradle tasks [clean, :app:assembleDebug]
C:\Users\Amninder\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\2d55d8c33dae479e599960c08d012b17\res\values\values.xml
Error:(246, 5) error: duplicate value for resource 'attr/font' with config ''.
Error:(246, 5) error: resource previously defined here.
C:\Users\Amninder\AndroidStudioProjects\circlebutton\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(254) duplicate value for resource 'attr/font' with config ''.
Error:(240) resource previously defined here.
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Information:BUILD FAILED in 19s
Information:6 errors
Information:0 warnings
Information:See complete output in console`
Below is a list of things I tried and failed.
1.removing attr/font on line 254 > doing save all > clean project > rebuild project.
I was inspired by this youtube video - https://www.youtube.com/watch?v=dF0m_PG111g so checked in its comments section. First, the comment was the same error. So, check this guy's blog. So I got to know the error was because of adding the library only. So I searched on google for - how to add a custom library in android referred to this. opened it and there was no info. regarding the error, I am facing.
Saw another link on the video, from StackOverflow this time.here is the link. He says "After renaming the library attribute to something else (text font), all went good again." I also tried renaming the attr/font to attr/1txtfont but changes were not reflected at all.
Can anyone here please help me out on this?
You're using support library version 26 which defines attribute attr/font and the library defines the same attribute, this is what causes the error.
So you either use support library version < 26, for example: com.android.support:appcompat-v7:25.3.1. Or the library owner rename the attribute
Thank you so much for your valuable insight y.allam. For any person who faces such an error. Below are the elaborated changes.
In your file build.gradle, change compileSdkVersion to 25 , targetSdkVersion to 25
.
Now in the same file, as sorted out by y.allam, change the SDK version to com.android.support:appcompat-v7:25.3.1.
[