Ionic-cli: ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android: font *

Created on 16 Mar 2018  路  8Comments  路  Source: ionic-team/ionic-cli

Hi , Please help me to solve this problem. since i have no idea to solve this.

Description:

I鈥檓 getting this error when deploying to build android ,
Failed to load resource: net::ERR_FILE_NOT_FOUND roboto-regular.woff2, took a look at assets/fonts folder and there is only 2 files: ionicons.woff and ionicons.woff2, all the other fonts are gone.

defaults Roboto fonts are not showing in www/assets/fonts folder.

Steps:

Example repo:

1.ionic cordova platform remove android

2.ionic cordova platform add android

3.ionic cordova build android

Output:
:processDebugResources
ERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle

ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight
ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':processDebugResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 52.543 secs
Error: /Users/arun-1702/FireSafety/fireSafety/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight
ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':processDebugResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

My ionic info:
cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.15.0
ionic (Ionic CLI) : 3.15.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.1 
ios-sim           : 5.0.13 
Node              : v8.4.0
npm               : 5.4.2 
OS                : OS X El Capitan
Xcode             : Xcode 8.2.1 Build version 8C1002

Environment Variables:

ANDROID_HOME : /Users/home/Library/Android/sdk

Misc:

backend : pro

Other Information:

1 ) cordova requirements android

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android-14,android-13,android-12
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle

2) cordova plugin list

cordova-plugin-badge 0.8.7 "Badge"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.4.0 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 2.2.0 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 6.0.8 "BarcodeScanner"
phonegap-plugin-push 2.1.2 "PushPlugin"

Most helpful comment

Install this plugin to fix this issue.
ionic cordova plugin add cordova-android-support-gradle-release --save
https://github.com/dpa99c/cordova-android-support-gradle-release

All 8 comments

remove local notifications plugin
update npm latest version
remove platforms , plugins, node_modules , package-lock.josn
npm install 鈥攕ave
then add platform android and build it
finally run android.
it鈥檚 working successfully.

I had de.appplant.cordova.plugin.local-notification plugin installed.
I removed it and the problem was solved.

Install this plugin to fix this issue.
ionic cordova plugin add cordova-android-support-gradle-release --save
https://github.com/dpa99c/cordova-android-support-gradle-release

I tried this @sreekanth-karini and it worked! Thanks, you are a rockstar!

I have removed local notifications plugin and also installed the cordova-android-support-gradle-release plugin but it did not fix and I still experience error messages trying to build an android version of my app.

The ionic info is the same as above

Error: /platforms/android/gradlew: Command failed with exit code 1 Error output:
ERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':processDebugResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

I updated the dependencies and installed ionic cordova plugin add cordova-android-support-gradle-release --save and finally got it fixed.

i have found this error when i run app
ERROR: In FontFamilyFont, unable to find attribute android:font
ERROR: In FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In FontFamilyFont, unable to find attribute android:fontWeight

here is my app.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.24.2'
}

}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

repositories {
maven { url "https://jitpack.io" }
}
repositories {
maven { url "http://maven.getsimpl.com" }
}
apply plugin: 'realm-android'
apply plugin: 'com.jakewharton.butterknife'
android {
// Other settings

buildTypes {
    release {
        resValue("bool", "FIREBASE_CRASH_ENABLED", "true")
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
        resValue("bool", "FIREBASE_CRASH_ENABLED", "true")
    }
}

}

android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.cloudbar.consumers"
minSdkVersion 19
targetSdkVersion 25
versionCode 71
versionName "71"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
resConfigs "en"
}
buildTypes {
release {

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        shrinkResources false
        minifyEnabled false

    }
    debug {
        minifyEnabled false
    }
}

aaptOptions {
    cruncherEnabled = false
}
lintOptions {

    checkReleaseBuilds false

}

}
repositories {
maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
mavenCentral()
}

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'
})
//for db debug
compile files('libs/android-support-v4.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}

compile files('libs/PGSDK_V2.0.jar')
compile 'com.orhanobut:dialogplus:1.11@aar'
compile files('libs/activation.jar')
compile 'com.zopim.android:sdk:1.3.3.1'
compile 'com.orhanobut:dialogplus:1.11@aar'
//noinspection GradleCompatible
compile 'com.android.support:support-v4:25.3.1'
compile 'org.ocpsoft.prettytime:prettytime:3.2.7.Final'
compile 'de.hdodenhof:circleimageview:2.1.0'

compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.github.apl-devs:appintro:v4.2.0'
compile 'com.android.support:support-v13:25.3.1'


compile 'com.razorpay:checkout:1.3.0'

compile 'com.theartofdev.edmodo:android-image-cropper:2.4.4'
compile 'devs.mulham.horizontalcalendar:horizontalcalendar:1.1.5'

compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.hbb20:ccp:1.8'
compile 'com.thoughtbot:expandablerecyclerview:1.3'
compile 'com.yarolegovich:lovely-dialog:1.0.4'
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
compile 'io.reactivex:rxjava:1.1.0'
compile 'com.github.mukeshsolanki:android-otpview-pinview:1.0.3'
compile 'com.chaos.view:pinview:1.1.0'
compile 'com.github.aakira:expandable-layout:1.6.0@aar'
compile 'com.facebook.stetho:stetho:1.5.0'

compile 'io.github.gjyaiya:stetho-realm:1.0'
compile 'com.github.stfalcon:smsverifycatcher:0.3'
compile 'com.github.jd-alexander:LikeButton:0.2.1'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.mikepenz:actionitembadge:3.3.1@aar'
compile 'com.mikepenz:iconics-core:2.9.3@aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.1@aar'
compile 'com.appsflyer:af-android-sdk:4.+@aar'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
compile 'com.facebook.android:facebook-core:4.36.1'
compile 'com.facebook.android:facebook-marketing:4.36.1'
compile 'com.wang.avi:library:2.1.3'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.simpl.android:sdk:1.1.+'

compile 'com.appsflyer:af-android-sdk:4.8.7@aar'
compile 'com.android.installreferrer:installreferrer:1.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'

compile 'com.google.firebase:firebase-crash:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'


compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.android.gms:play-services-analytics:11.0.4'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-places:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'

compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.okhttp3:okhttp:3.9.1'

}
apply plugin: 'com.google.gms.google-services'

Please help to solve this error

Was this page helpful?
0 / 5 - 0 ratings