Onesignal-android-sdk: android:attr/fontStyle not found

Created on 25 Dec 2017  路  10Comments  路  Source: OneSignal/OneSignal-Android-SDK

I get an error when i try to build my project:

**..\.gradle\caches\transforms-1\files-1.1\support-compat-27.0.2.aar\08f363ab7bde2858b8704686c719979a\res\values\values.xml
Error:(20, 5) error: resource android:attr/fontStyle not found.
Error:(20, 5) error: resource android:attr/font not found.
Error:(20, 5) error: resource android:attr/fontWeight not found.****

I use:

compileSdkVersion 22
minSdkVersion 15
targetSdkVersion 22
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.onesignal:OneSignal:[3.6.5,3.99.99]'
    compile 'com.android.support:appcompat-v7:22.2.1'
}
Needs More Information

Most helpful comment

@kiberzoid You have compileSdkVersion 22 which is quite old. Can you try updating to compileSdkVersion 27. You will also need to update the Android SDK on your system if you haven't already.

Google also recommends keeping targetSdkVersion up to date as well. However you should read through Google's migration guides to ensure there are no issue for your app.
https://developer.android.com/about/versions/oreo/android-8.0-migration.html

All 10 comments

@kiberzoid You have compileSdkVersion 22 which is quite old. Can you try updating to compileSdkVersion 27. You will also need to update the Android SDK on your system if you haven't already.

Google also recommends keeping targetSdkVersion up to date as well. However you should read through Google's migration guides to ensure there are no issue for your app.
https://developer.android.com/about/versions/oreo/android-8.0-migration.html

@kiberzoid Closing due to inactivity. Feel free to reply with more details and we can reopen if you are still seeing this issue

Hi,
i am also getting this error while building my project.

Error are as follow;
error: resource android:attr/fontStyle not found. | 聽
error: resource android:attr/font not found. | 聽
error: resource android:attr/fontWeight not found. | 聽
error: resource android:attr/fontVariationSettings not found. | 聽
error: resource android:attr/ttcIndex not found. | 聽
error: resource android:attr/startX not found. | 聽
error: resource android:attr/startY not found. | 聽
error: resource android:attr/endX not found. | 聽
error: resource android:attr/endY not found. | 聽
error: resource android:attr/offset not found. | 聽

@jkasten2 my SDK details are;

android {
compileSdkVersion 23
buildToolsVersion '27.0.3'

defaultConfig {
    applicationId "brainbreaker.bargainhawk"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}

I am also facing same error of Android resource linking failed. Unable to find any solution.

Same error with compileSdkVersion 29

Got same error and fixed it

doc says "Android 8.0 (API level 26) introduces a new feature, Fonts in XML, which lets you use fonts as resources." So, by changing build.gradle

[from]
defaultTargetSdkVersion=25
defaultCompileSdkVersion=25

[To]
defaultTargetSdkVersion=26
defaultCompileSdkVersion=26

Same error with compileSdkVersion 29

Same error with compileSdkVersion 29

I also have the same problem when building apk with skd29. what i do is

  1. add dependencies {
    聽聽 compile 'com.android.support:appcompat-v7:26.0.0'
    }
    source: https://developer.android.com/about/versions/oreo/android-8.0-migration.html

  2. add build release tools
    android {
    聽聽聽聽 buildToolsVersion "29.0.3"
    聽聽聽聽 ...
    }
    source: https://developer.android.com/studio/releases/build-tools

and this work. i hopefully this resolves your problem

Was this page helpful?
0 / 5 - 0 ratings