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

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

问题描述

我试图从版本> 25.3.1 升级到版本 26.XX 的支持库,但每次使用新版本构建项目时,都会收到以下错误消息:
$ b

  Error :( 357)属性font已经用不兼容格式定义。 
错误:(343)此处定义的原始属性。

错误:java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:执行
过程时出现错误/ Users / johnsmith / Library / Android /sdk/build-tools/26.0.1/aapt带参数的
{package -f --no-crunch -I ...

我曾尝试清洁和重建。我也尝试了无效缓存并重新启动Android Studio。



这个应用程序的版本 25.3.1 支持库。我正在使用Android Studio 3.0 Beta 2,其版本为 3.0.0-beta2 的Android Gradle插件。 >解决方案

由于这个错误是:


  • Android O特定的,

  • font 属性相关,并且
  • aapt ,



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


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 ...

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

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.

解决方案

Since this error is:

  • Android O specific,
  • related to a font attribute, and
  • an error thrown by aapt,

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构建错误:属性“font”已经定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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