Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Element font-family must be declared

Tags:

android

when i open a project from github ,the folder from res folder has a xml resource product_famliy.xml but android studio has a error:

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>
like image 849
uglyant Avatar asked Jul 01 '17 01:07

uglyant


People also ask

How do you add a font family in HTML?

To change font type purely with HTML, use the CSS font-family property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.

When using a font stack to declare the font family in what order should the values appear?

A font stack is a list of fonts in the CSS font-family declaration. The fonts are listed in order of preference that you would like them to appear in case of a problem, such as a font not loading.

Should I put font family HTML or body?

font-family is a CSS property, so it belongs neither to the html nor the body tag.

How does font family work in CSS?

The font-family property can hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font. There are two types of font family names: family-name - The name of a font-family, like "times", "courier", "arial", etc.


1 Answers

I guess you need Android Studio 3.0

like image 103
张俊雄 Avatar answered Oct 19 '22 14:10

张俊雄