25

When I run

ionic cordova build android --prod

it shows errors below:

    ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> 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: 9.11 secs

Error: /Users/cqismgis/Desktop/MobileGIS/platforms/android/gradlew: Command failed with exit code 1 Error output:
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> 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.

and in AndroidStudio, I clikc 'Build' button, it shows:

    Error:In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
    Error:Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

I don't know how to fix it, please tell me the detail of fix steps.

Ivan.Yang
  • 287
  • 1
  • 3
  • 8

1 Answers1

33

To solve that :

you_app_folder/plugin and look for plugin.xml in all the plugins

Go to your plugin folder, search in that directory for :

com.android.support:support-v4:+

OR

com.android.support:support-v4:24.1.1+

OR

com.android.support:appcompat-v7:28.0.0

Change it with :

com.android.support:support-v4:27.1.0

OR

com.android.support:appcompat-v7:27.1.1

then

Also, I executed

ionic cordova platform remove android 

and

ionic cordova platform add android
Community
  • 1
  • 1
M0ns1f
  • 2,705
  • 3
  • 15
  • 25
  • Hi, can you please tell me where exactly I've to go and change the version? – Shihan Khan Mar 11 '18 at 11:47
  • 1
    @ShihanKhan you_app_folder/plugin and look for plugin.xml in all the plugins – M0ns1f Mar 11 '18 at 13:56
  • 1
    I had the same problem and changing from `com.android.support:support-v4:+` to compile `com.android.support:support-v4:23.+` fixed it for me. – Pavel Shorokhov Mar 19 '18 at 14:11
  • Thanks , works great – Amr.Ayoub Mar 21 '18 at 13:38
  • 2
    I fixed it by editing `platforms/android/build.gradle` according to https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/205#issuecomment-371669478 – Captain May 18 '18 at 11:31
  • Added this to `build-extras.gradle` configurations.all { resolutionStrategy { force 'com.android.support:support-v4:26+' } } Found info at - https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/205#issuecomment-371669478 – nanusdad Jun 02 '18 at 10:12
  • 1
    @nanusdad this is an option to change only the module you want to upgrade, not all of them – M0ns1f Jun 02 '18 at 12:55