Android 支持库构建 v26.X.X 构建错误:属性“字体"已经定义 [英] Android Support Library Build v26.X.X Build Error: Attribute "font" already defined

查看:29
本文介绍了Android 支持库构建 v26.X.X 构建错误:属性“字体"已经定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从支持库的版本 25.3.1 升级到版本 26.XX,但每次我使用较新的版本构建项目时得到这个错误:

I'm trying to upgrade from version 25.3.1 to version 26.X.X of the support library, but every time I build the project using the newer version I get this error:

Error:(357) Attribute "font" already defined with incompatible format.
Error:(343) Original attribute defined here.

Error:java.util.concurrent.ExecutionException: 
com.android.ide.common.process.ProcessException: Error while executing 
process /Users/johnsmith/Library/Android/sdk/build-tools/26.0.1/aapt 
with arguments {package -f --no-crunch -I ...

我尝试过清理和重建.我也尝试过使缓存无效并重新启动 Android Studio.

I have tried cleaning and rebuilding. I have also tried invalidating caches and restarting Android Studio.

该应用程序使用支持库的 25.3.1 版本构建良好.我正在使用 Android Studio 3.0 Beta 2 和 Android Gradle 插件的 3.0.0-beta2 版本.

The app builds fine with version 25.3.1 of the support library. I'm using Android Studio 3.0 Beta 2 with version 3.0.0-beta2 of the Android Gradle plugin.

推荐答案

由于这个错误是:

  • Android O 特定,
  • font 属性相关,以及
  • aapt 抛出的错误,
  • Android O specific,
  • related to a font attribute, and
  • an error thrown by aapt,

我的猜测是您在应用程序代码中定义了一个名为 font 的自定义属性,该属性与 android-namespaced font 在 Android O 中引入的属性.尝试重命名或删除该自定义属性.

my guess is that you have defined a custom attribute named font in your application code that conflicts in some manner with the android-namespaced font attribute introduced in Android O. Try renaming or removing that custom attribute.

这篇关于Android 支持库构建 v26.X.X 构建错误:属性“字体"已经定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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