当我从github打开一个项目时,res文件夹中的文件夹有一个xml资源product_famliy.xml,但是android有一个错误:
Information:Gradle tasks [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
E:\googledownload\PaperPlane-master\app\src\main\res\font\product_family.xml
Error:Error: Unsupported type 'font'
Error:Execution failed for task ':app:mergeDebugResources'.
> E:\googledownload\PaperPlane-master\app\src\main\res\font\product_family.xml: Error: Unsupported type 'font'
Information:BUILD FAILED
Information:Total time: 21.311 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console <?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/product_sans_regular"
app:fontStyle="normal"
app:fontWeight="400"
app:font="@font/product_sans_regular"/>
<font
android:fontStyle="italic"
android:fontWeight="400"
android:font="@font/product_sans_italic"
app:fontStyle="italic"
app:fontWeight="400"
app:font="@font/product_sans_italic"/>
</font-family>发布于 2017-07-11 07:49:42
我想你需要Android Studio 3.0
发布于 2017-08-21 18:15:20
这是新的Android版本(Android26)的一个新功能。
要让它使用XML中的字体,您需要安装AndroidStudio3.x并使用最新的verion (26)进行编译。
此外,请参阅此处:https://developer.android.com/preview/features/working-with-fonts.html
https://stackoverflow.com/questions/44856685
复制相似问题