Android的工作室Aapt.exe完成了非零退出值1 [英] Android studio Aapt.exe finished with non zero exit value 1

查看:636
本文介绍了Android的工作室Aapt.exe完成了非零退出值1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我使用谷歌播放服务和其他一些人,所有按预期正常工作。但是当我谈到对设计方,我被要求使用的分段控制,因为我们在IOS 7所以使用这个库这个我累了。

但是当我加入这个库和同步我得到这个错误


  

错误:执行失败的任务。':应用程序:processDebugResources


  
  

    

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:过程'命令'E:\\斯泰西
    数据\\ AndroidStudio \\ SDK \\构建工具\\ 22.0.1 \\ aapt.exe''与完成
    非零值1


  

和错误消息是这样的:


  

AGPBI:{种:ERROR,文:属性\\BORDER_WIDTH \\已
  一直
  defined\",\"sourcePath\":\"C:\\Users\\stacy\\Desktop\\$p$pmioApp\\app\\build\\intermediates\\exploded-aar\\com.google.android.gms\\play-services-wallet\\7.5.0\\res\\values\\wallet_colors.xml\",\"position\":{\"startLine\":1},\"original\":\"\"}


所以,我不知道什么来替代,如何处理它。我的情况是从别人不同,别人的错误只是说要删除或重命名他们的应用程序的冲突,但在我的应用程序的绘图资源或资源的两个图书馆之间的资源去我那么如何打算解决这个问题?是什么解决办法?请帮帮我。


解决方案

我使用的 Android的段控制自定义视图。我认为这个问题带有较新的生成工具版本(现在是我的是22.0.1)带来一些默认BORDER_WIDTH值。

要删除自定义BORDER_WIDTH:


  • attrs.xml 的文件中删除了border_with属性,所以才有了下面仍然是:

     <申报-设置样式名称=SegmentedGroup>
        < attr指示NAME =corner_radius格式=维/>
        < attr指示NAME =tint_color格式=色/>
        < attr指示NAME =checked_text_color格式=色/>
    < /申报,设置样式>


  • SegmentedGroup.java 的文件中删除了mMarginDp变量所以才有了下面仍然是:

      {尝试    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));} {最后
        typedArray.recycle();
    }


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.

解决方案

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();
    }
    

这篇关于Android的工作室Aapt.exe完成了非零退出值1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆