aapt因FontFamilyFont错误而失败

时间:2017-11-26 03:16:34

标签: android

免责声明:我是Android开发的新手。

Android SDK:7.1.1,API级别25 rev 3。

构建工具:25.0.3

AndroidManifest.xml:<uses-sdk android:minSdkVersion="25" android:targetSdkVersion="25"/>

使用对项目的依赖:

    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>support-compat</artifactId>
        <version>27.0.0</version>
        <type>aar</type>
    </dependency>

构建获取我(来自aapt.exe):

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight

当我将support-compat版本更改为25.0.1时,没有错误。

但是,我需要一个来自27的功能(FontRequest),据我所知,这就是支持库的用途。

知道它为什么不会构建?感谢。

1 个答案:

答案 0 :(得分:0)

正如@diegoveloper所提到的,编译SDK版本必须是27,即至少使用支持库的版本。更多信息:

https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd

但是,使用27个构建工具进行编译不起作用,因为IntelliJ IDEA Android插件中存在一个错误:https://youtrack.jetbrains.com/issue/IDEA-177053

保持SDK 27,但回到25个构建工具就可以了。这只影响IntelliJ IDEA,android-maven-plugin工作正常。