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.

2

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

6 Comments

Hi, can you please tell me where exactly I've to go and change the version?
@ShihanKhan you_app_folder/plugin and look for plugin.xml in all the plugins
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.
I fixed it by editing platforms/android/build.gradle according to github.com/crosswalk-project/cordova-plugin-crosswalk-webview/…
@nanusdad this is an option to change only the module you want to upgrade, not all of them
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.