Gustavo Henrique
Gustavo Henrique

Reputation: 33

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.

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.

Upvotes: 1

Views: 1833

Answers (2)

Gustavo Henrique
Gustavo Henrique

Reputation: 33

Thanks for the help!

I got a build successful by adding this in the build-extras.gradle file:

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

And by installing the cordova-android-support-gradle-release.

Upvotes: 2

Tboxmy
Tboxmy

Reputation: 86

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.

Upvotes: 0

Related Questions