为了账号安全,请及时绑定邮箱和手机立即绑定

升级v4到v7,编译报错

老师您好,我尝试把例子的v4升级到v7,sdk从原来的升级到21。编译的时候,报了如下错误信息:

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    E:\app\Android\sdk\build-tools\21.1.2\aapt.exe package -f --no-crunch -I E:\app\Android\sdk\platforms\android-21\android.jar -M F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\res\debug -A F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\assets\debug -m -J F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\generated\source\r\debug -F F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.hong.chat -0 apk --output-text-symbols F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\symbols\debug
Error Code:
    1
Output:
    F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\res\debug\values\values.xml:78: error: Attribute "icon" has already been defined
    F:\dev\wetrade\bbt\study\android-std-wx-demo\demo2\app\build\intermediates\res\debug\values\values.xml:86: error: Attribute "color" has already been defined


请问这是什么问题导致的?如何修复?

错误信息里指示的values.xml第78和86行错误如下所示:

--------------------------------------------------

<declare-styleable name="ActionBar"><attr name="navigationMode"><enum name="normal" value="0"/><enum name="listMode" value="1"/><enum name="tabMode" value="2"/></attr><attr name="displayOptions"><flag name="none" value="0"/><flag name="useLogo" value="0x1"/><flag name="showHome" value="0x2"/><flag name="homeAsUp" value="0x4"/><flag name="showTitle" value="0x8"/><flag name="showCustom" value="0x10"/><flag name="disableHome" value="0x20"/></attr><attr name="title"/><attr format="string" name="subtitle"/><attr format="reference" name="titleTextStyle"/><attr format="reference" name="subtitleTextStyle"/><attr format="reference" name="icon"/><attr format="reference" name="logo"/><attr format="reference" name="divider"/><attr format="reference" name="background"/><attr format="reference|color" name="backgroundStacked"/><attr format="reference|color" name="backgroundSplit"/><attr format="reference" name="customNavigationLayout"/><attr name="height"/><attr format="reference" name="homeLayout"/><attr format="reference" name="progressBarStyle"/><attr format="reference" name="indeterminateProgressStyle"/><attr format="dimension" name="progressBarPadding"/><attr name="homeAsUpIndicator"/><attr format="dimension" name="itemPadding"/><attr format="boolean" name="hideOnContentScroll"/><attr format="dimension" name="contentInsetStart"/><attr format="dimension" name="contentInsetEnd"/><attr format="dimension" name="contentInsetLeft"/><attr format="dimension" name="contentInsetRight"/><attr format="dimension" name="elevation"/><attr format="reference" name="popupTheme"/></declare-styleable>

----------------------------------------------



------------------------------------------------

    <declare-styleable name="DrawerArrowToggle"><attr format="color" name="color"/><attr format="boolean" name="spinBars"/><attr format="dimension" name="drawableSize"/><attr format="dimension" name="gapBetweenBars"/><attr format="dimension" name="topBottomBarArrowSize"/><attr format="dimension" name="middleBarArrowSize"/><attr format="dimension" name="barSize"/><attr format="dimension" name="thickness"/></declare-styleable>

------------------------------------------------

正在回答

1 回答

老师的代码好像在V7上要改很多东西,要你直接运行的话,应该是在V4上完美运行

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
微信6.0主界面
  • 参与学习       58953    人
  • 解答问题       174    个

本课程将讲解微信6.0主界面的实现方法,微信5.2.1后续课程

进入课程

升级v4到v7,编译报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信