title: Custom Fonts with Support Library is not working on a real device
body: <p>I have used custom font with Support Library API 26. I have created font-family using style and add style to my text view. I found that font is going to set in Preview during design, but not working in android real devices. Below is my code and I have also attached screenshot. Thanks in advance.</p>
  <p><strong>TextView:</strong></p>
  <pre><code>&lt;TextView
      android:id=&quot;@+id/card_number_text&quot;
      android:layout_width=&quot;0dp&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:text=&quot;111 5235 5563 8845&quot;
      android:gravity=&quot;left&quot;
      android:layout_marginRight=&quot;8dp&quot;
      app:layout_constraintRight_toRightOf=&quot;parent&quot;
      android:layout_marginTop=&quot;8dp&quot;
      style=&quot;@style/creditCardText&quot;
      app:layout_constraintTop_toBottomOf=&quot;@+id/payableLayout&quot;
      app:layout_constraintLeft_toLeftOf=&quot;@+id/payableLayout&quot;
      app:layout_constraintHorizontal_bias=&quot;0.0&quot; /&gt;
  </code></pre>
  <p><strong>Style.xml:</strong></p>
  <pre><code>&lt;style name=&quot;creditCardText&quot;&gt;
      &lt;item name=&quot;android:textSize&quot;&gt;@dimen/textSizeLarge&lt;/item&gt;
      &lt;item name=&quot;android:fontFamily&quot;&gt;@font/font_roboto_medium&lt;/item&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;@color/color_card_number&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  <p><strong>Font Family:</strong></p>
  <pre><code>&lt;font-family xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  &lt;font
      android:fontStyle=&quot;normal&quot;
      android:fontWeight=&quot;400&quot;
      android:font=&quot;@font/roboto_medium&quot; /&gt;
  </code></pre>
  
  <p><strong>build.gradle:</strong></p>
  <pre><code>apply plugin: 'com.android.application'
  buildscript {
      repositories {
      }
      dependencies {
     }
  }
  
  android {
      signingConfigs {
      }
     compileSdkVersion 26
     defaultConfig {
          applicationId &quot;org.saifintex.skypaytrans&quot;
          minSdkVersion 18
          targetSdkVersion 26
          vectorDrawables.useSupportLibrary = true
          versionCode 7
          multiDexEnabled true
          versionName &quot;1.6&quot;
          testInstrumentationRunner 
          &quot;android.support.test.runner.AndroidJUnitRunner&quot;
          externalNativeBuild {
              cmake {
                  cppFlags &quot;&quot;
              }
          }
     }
  
  lintOptions {
      abortOnError false        // true by default
      checkAllWarnings false
      checkReleaseBuilds false
      ignoreWarnings true       // false by default
      quiet true                // false by default
  }
  
  repositories {
      maven { url &quot;https://jitpack.io&quot; }
  }
  dexOptions {
      javaMaxHeapSize &quot;4g&quot;
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
      debug {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  
      }
  }
  externalNativeBuild {
      cmake {
          path &quot;CMakeLists.txt&quot;
      }
  }
  packagingOptions {
      exclude 'META-INF/DEPENDENCIES'
      exclude 'META-INF/NOTICE'
      exclude 'META-INF/LICENSE'
      exclude 'META-INF/LICENSE.txt'
      exclude 'META-INF/NOTICE.txt'
  }
  productFlavors {
  }
  sourceSets {
      main {
          assets.srcDirs = ['src/main/assets', 'src/main/assets/']
          java.srcDirs = ['src/main/java', 'src/main/java/fonts']
      }
    }
  }
  
  dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
  {
      exclude group: 'com.android.support', module: 'support-annotations'
  })
  compile &quot;com.android.support:appcompat-v7:26.1.0&quot;
  compile &quot;com.android.support:design:26.1.0&quot;
  compile &quot;com.android.support:recyclerview-v7:26.1.0&quot;
  compile project(':tooltip')
  compile project(':mylibrary')
  compile fileTree(include: ['*.jar'], dir: 'libs')
  compile &quot;com.j256.ormlite:ormlite-
  android:${rootProject.ormliteAndroidVersion}&quot;
  compile &quot;com.j256.ormlite:ormlite-core:${rootProject.ormliteCoreVersion}&quot;
  testCompile 'junit:junit:4.12'
  compile 'com.afollestad.material-dialogs:core:0.9.4.2'
  compile 'com.fasterxml.jackson.core:jackson-core:2.7.2'
  compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.2'
  compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
  compile 'com.soundcloud.android:android-crop:1.0.1@aar'
  compile 'com.jakewharton:butterknife:7.0.1'
  compile 'com.android.volley:volley:1.0.0'
  compile 'commons-codec:commons-codec:1.10'
  compile 'com.android.support:design:26.1.0'
  compile 'com.squareup.picasso:picasso:2.4.0'
  compile 'com.google.firebase:firebase-messaging:11.0.1'
  compile 'com.google.firebase:firebase-core:11.0.1'
  compile 'com.android.support:cardview-v7:26.1.0'
  compile 'com.android.support:support-v4:26.1.0'
  compile 'com.wang.avi:library:2.1.3'
  compile 'com.github.ayalma:ExpandableRecyclerView:0.2.0'
  compile 'com.github.deano2390:MaterialShowcaseView:1.1.0'
  compile 'com.android.support.constraint:constraint-layout:1.0.2'
  compile 'com.google.firebase:firebase-crash:11.0.1'
  compile 'com.google.firebase:firebase-auth:11.0.1'
  compile 'com.google.android.gms:play-services-analytics:11.0.1'
  compile 'com.alimuzaffar.lib:pinentryedittext:1.3.1'
  androidTestImplementation 'com.android.support.test:runner:1.0.1'
  androidTestImplementation 'com.android.support.test.espresso:espresso-
  core:3.0.1'
  testCompile 'junit:junit:4.12'
  }
  
  configurations.all {
  resolutionStrategy.eachDependency { DependencyResolveDetails details -&gt;
      def requested = details.requested
      if (requested.group == 'com.android.support') {
          if (!requested.name.startsWith(&quot;multidex&quot;) &amp;&amp; 
          !requested.name.startsWith(&quot;crash&quot;)) {
              details.useVersion '25.3.1'
          }
      }
  }
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p><strong>Font resource dir:</strong></p>
  <p><a href="https://i.stack.imgur.com/dFjx1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dFjx1.png" alt="enter image description here" /></a></p>
  <p><strong>Design preview:</strong> Here font is working</p>
  <p><a href="https://i.stack.imgur.com/109JZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/109JZ.png" alt="enter image description here" /></a></p>
  <p><strong>Android Device Screenshot:</strong> Here font is not working</p>
  <p><a href="https://i.stack.imgur.com/3Ewdh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3Ewdh.png" alt="enter image description here" /></a></p>