Search code examples
androidcordovaandroid-studioconstruct

Cordova build to Android error


I made an app with Construct 2 and I exported to Intel XDK. Then I exported to cordova and everytime I try to build with "cordova build android" I get this error:

ERROR: In FontFamilyFont, unable to find attribute android:t tcIndex

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: 47.337 secs

Command finished with error code 1: cmd /s /c "C:\Users\Gustavo\app\platfo
rms\android\gradlew.bat cdvBuildDebug -b C:\Users\Gustavo\app\platforms\an
droid\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pand
roid.useDeprecatedNdk=true"
Error: cmd: 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 <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

It's my first time posting here, so if I am doing something wrong, please tell me.


Solution

  • Gustavo,

    Its is possible that you have a conflict in cordova plugins or platform. A second possiblity is that, you have added components via npm but haven't installed it. For both scenario, I suggest that you list out the current versions installed, note them down then do an update to cordova. Here is how to list out the versions, like what I have.

    cd projectfolder $ cordova plugin cordova-plugin-console 1.1.0 "Console" cordova-plugin-device 2.0.1 "Device" cordova-plugin-whitelist 1.3.3 "Whitelist" $ cordova platform Installed platforms: android 7.0.0 browser 5.0.3 Available platforms: ios ~4.5.4 osx ~4.0.1 windows ~5.0.0 www ^3.12.0 $ npm -v 3.10.10

    Here is how you update cordova for the project. This example assumes you are using android platform. If you have other plugins/platform, do the necessary.

    npm install
    npm update
    cordova platform rm android --nosave
    cordova platform add android
    

    Alternatively

    cordova platform update android
    

    If you notice a specific plugin with version error, remove and the plugin with required version.