0

In My app I am using google play services and some others and all are working fine as expected. but when I comes towards the design side , I was asked to used the segmented control as we have in IOS 7. so for this I tired using this library.

But as i added this library and sync I got this error

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\Stacy Data\AndroidStudio\SDK\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

And the Error message is this :

AGPBI: {"kind":"ERROR","text":"Attribute \"border_width\" has already been defined","sourcePath":"C:\Users\stacy\Desktop\premioApp\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-wallet\7.5.0\res\values\wallet_colors.xml","position":{"startLine":1},"original":""}

So I have no Idea what to replace and How to handle it. My case is different from others as others errors are just saying to remove or rename the drawables or resources of their app but in my app the conflicts is going between two libraries resources so How I am going to tackle this problem ? what is a solution of this? Please Help me.

stacy queen
  • 280
  • 1
  • 4
  • 19
  • If the library is open source you could always modify the values resource to prevent this but then you would need to maintain a fork of this library and keep updating it.. You need to look in the `values` directory of the library source for `border_width` attribute – ashkhn Jul 23 '15 at 09:04
  • is there any other solution ? – stacy queen Jul 23 '15 at 09:06
  • I guess not.. There was an issue on the android issue tracker regarding this but it was closed saying that it was working as intended.. [Link to the issue](https://code.google.com/p/android/issues/detail?id=22576) – ashkhn Jul 23 '15 at 09:19
  • have you tried using latest builToolVersion and gradle version – shine_joseph Jul 23 '15 at 10:57
  • I am using this tool version 22.0.1 – stacy queen Jul 23 '15 at 11:07
  • and gradle is : classpath 'com.android.tools.build:gradle:1.1.0' – stacy queen Jul 23 '15 at 11:07

1 Answers1

0

I had the same problem when using the android-segment-control custom view. I think the problem comes with the newer Build Tools version (mine is now 22.0.1) which brings some default border_width value.

To remove the custom border_width:

  • In the attrs.xml file remove the "border_with" attribute so only the following remains:

    <declare-styleable name="SegmentedGroup">
        <attr name="corner_radius" format="dimension" />
        <attr name="tint_color" format="color" />
        <attr name="checked_text_color" format="color" />
    </declare-styleable>
    
  • In the SegmentedGroup.java file remove the "mMarginDp" variable so only the following remains:

    try {
    
        mCornerRadius = typedArray.getDimension(
                R.styleable.SegmentedGroup_corner_radius,
                getResources().getDimension(R.dimen.radio_button_conner_radius));
    
        mTintColor = typedArray.getColor(
                R.styleable.SegmentedGroup_tint_color,
                getResources().getColor(R.color.radio_button_selected_color));
    
        mCheckedTextColor = typedArray.getColor(
                R.styleable.SegmentedGroup_checked_text_color,
                getResources().getColor(android.R.color.white));
    
    } finally {
        typedArray.recycle();
    }