Unable to build android (because of duplicate dependecies ?) - android

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

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.

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

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.

Gradle Error : Duplicate value for resource 'attr/font' with config " solutions not working [duplicate]

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.
[

React Native suddenly fail to build

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.

Gradle build shows error: Unsupported node 'item'

My project does not gradle it shows:
Error:Execution failed for
task ':app:mergeDebugResources'.
D:\Android\MatarealDesigen\app\src\main\res\values\styles.xml: Error: Unsupported node 'item'
Please go to res/values/styles.xml and find the error there. One of the tags called "item" is probably in the wrong place (it should be highlighted in red) :-)
In my case the name of one of the attributes was misspelled:
tye="layout"
instead of
type="layout"

Categories

Resources