【发布时间】:2017-12-14 14:27:21
【问题描述】:
在将 supportlibs 更新到 27.0.2 并将 compileVersion 更新到 27 后,我收到以下错误消息
Error:(252, 5) Attribute "font" already defined with incompatible format.
> /home/ralfi/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.1.aar/644e31926a52609e6fffe47c9016abcc/res/values/values.xml
> Error:(252, 5) Attribute "font" already defined with incompatible
> format. Error:(252, 5) Original attribute defined here.
> /home/ralfi/ProjectFolder/android-example/app/build/intermediates/res/merged/internal/debug/values/values.xml
> Error:(631) Attribute "font" already defined with incompatible format.
> Error:(607) Original attribute defined here.
还有这个:
> Error:java.util.concurrent.ExecutionException:
> com.android.ide.common.process.ProcessException: Error while executing
> process /opt/sdk/build-tools/26.0.2/aapt with arguments {package -f
> --no-crunch -I /opt/sdk/platforms/android-27/android.jar -M /home/ralfi/ProjectFolder/android-example/build/intermediates/manifests/full/internal/debug/AndroidManifest.xml
> -S /home/ralfi/ProjectFolder/android-example/build/intermediates/res/merged/internal/debug
> -m -J /home/ralfi/ProjectFolder/android-example/build/generated/source/r/internal/debug
> -F /home/ralfi/ProjectFolder/android-example/build/intermediates/res/internal/debug/resources-internalDebug.ap_
> -D /home/ralfi/ProjectFolder/android-example/build/intermediates/multi-dex/internal/debug/manifest_keep.txt
> --custom-package com.example.android -0 apk -c de,en --output-text-symbols /home/ralfi/ProjectFolder/android-example/build/intermediates/symbols/internal/debug
> --no-version-vectors}
- 将 supportLibs 设置回 25 也会告诉我同样的错误。
- 删除构建文件夹没有帮助
在我的 values/attrs.xml 中编辑与字体相关的名称仅出现如下:
<declare-styleable name="Styleable">
<attr name="fontFace" format="string"/>
<attr name="underlined" format="boolean"/>
<attr name="android:lineSpacingMultiplier"/>
<attr name="android:textSize"/>
</declare-styleable>
还有这个标签:
<attr name="minFontSize" format="reference|dimension"/>
【问题讨论】:
-
您使用的是自定义 TextView 还是 EditText?
-
看起来 font 是一个在某处声明了两次(或多次)的变量
-
不要在@RalfWickum 外部添加 gradle 文件。将它们直接添加到问题中
标签: android android-studio gradle aapt build-tools