Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Error -Ionic Cordova fails for android [duplicate]

I get following error while running the command "ionic cordova build android --stacktrace" :

:generateDebugResources
:mergeDebugResources

:processDebugManifest

:processDebugResources
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
 FAILED
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex

I am using following tools on Window's:
 Editor : VScode

Ionic: C:\Users\xyz>ionic -version
3.19.1
Npm as packagemanager

Project Properties:

target=android-26
cordova.system.library.1=com.google.android.gms:play-services-analytics:+
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.+
cordova.gradle.include.1=cordova-plugin-appsflyer-sdk/customerapp-cordovaAF.gradle
cordova.gradle.include.2=twitter-connect-plugin/customerapp-twitter.gradle
cordova.system.library.3=com.android.support:support-v4:26.+
cordova.system.library.4=com.android.support:appcompat-v7:26.+
cordova.system.library.5=com.android.support:support-v4:24.1.1+
cordova.system.library.6=com.android.support:support-v4:+
android.library.reference.1=CordovaLib
like image 714
Kumar Avatar asked Mar 08 '18 00:03

Kumar


Video Answer


3 Answers

I had to do the stuff of both the answers above:

In platforms/android/phonegap-plugin-barcodescanner:

Search for compile 'com.android.support:support-v4:+ and replace for compile 'com.android.support:support-v4:27+'.

In platforms/android:

Search for cordova.system.library.2=com.android.support:support-v4:+ and replace for cordova.system.library.2=com.android.support:support-v4:27.1.0.

Hope it helps.

like image 180
David López Avatar answered Oct 23 '22 21:10

David López


Mine required a similar fix as above only it was in the de.appplant.cordova.plugin.local-notification plugin. I changed ‘com.android.support:support-v4:+’ to ‘com.android.support:support-v4:23+’ and then removed and added the android platform and it built. However, I had an extra brace '}' in my build-extras.gradle that had to be removed also.

like image 3
Mark A. Rupert Avatar answered Oct 23 '22 19:10

Mark A. Rupert


found this on the ionic forum https://forum.ionicframework.com/t/android-build-broken-after-gradle-dependencies-update-execution-failed-for-task-processdebugresources-com-android-ide-common-process-processexception-failed-to-execute-aapt/109982/134 the suggestion that worked for me was "I got it working, my issue was in the cordova-plugin-file-opener2.
Change com.android.support:support-v4:+ to com.android.support:support-v4:23+ in the plugin.xml for the cordova-plugin-file-opener2 in the plugins folder and the node_modules folder.
Then do the same in the project.properties in platforms/android.
My plugin however was the background-geolocation and actually i dont believe i had to make a fix in the project.properties for mine.

like image 3
Spencer Hehl Avatar answered Oct 23 '22 21:10

Spencer Hehl