Android build broken after gradle dependencies update: Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt

This is the full error

	activity#com.urbanairship.cordova.CustomLandingPageActivity was tagged at AndroidManifest.xml:72 to replace another declaration but no other declaration present
:processArmv7DebugResources
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> 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: 26.079 secs
Error: /Users/Eugene/Development/Repos/Pfizer/newton-miguia/platforms/android/gradlew: 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:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> 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.

[ERROR] An error occurred while running cordova build android (exit code 1).

Not sure if I need to update all my dependencies as I’ve created a new fresh Ionic side menu project with no plugins, added Android platform and this builds fine, on same machine

Same computer, take a look again, in the project with error I am using Crosswalk and the project created with ionic start is using ionic-webview, I don’t know if this is a relevant information but can help

Possibly related? https://twitter.com/jcesarmobile/status/923312847970619393

1 Like

Not this problem in particular as no one reports having installed new Android Studio. Problems there are also different.

Probably something with dynamically loaded Gradle, Android SDK 27 things…

Thanks, can you post the whole command output, not just the error part? We need more context :confused:

Sorry here you go:

Eugenes-MacBook-Pro:newton-miguia Eugene$ ionic cordova build android --prod
Running app-scripts build: --prod --platform android --target cordova
[13:59:06]  build prod started ... 
[13:59:06]  clean started ... 
[13:59:06]  clean finished in 7 ms 
[13:59:06]  copy started ... 
[13:59:06]  ngc started ... 
Warning: Can't resolve all parameters for WebAudioTrack in /Users/Eugene/Development/Repos/Pfizer/newton-miguia/node_modules/ionic-audio/dist/ionic-audio-web-track.d.ts: (?, ?). This will become an error in Angular v5.x
Warning: Can't resolve all parameters for CordovaAudioTrack in /Users/Eugene/Development/Repos/Pfizer/newton-miguia/node_modules/ionic-audio/dist/ionic-audio-cordova-track.d.ts: (?). This will become an error in Angular v5.x
[13:59:22]  ngc finished in 16.41 s 
[13:59:22]  preprocess started ... 
[13:59:22]  deeplinks started ... 
[13:59:24]  deeplinks finished in 1.55 s 
[13:59:24]  optimization started ... 
[13:59:53]  optimization finished in 29.36 s 
[13:59:53]  preprocess finished in 30.91 s 
[13:59:53]  webpack started ... 
[13:59:53]  copy finished in 47.48 s 
[14:02:10]  webpack finished in 136.59 s 
[14:02:10]  sass started ... 
[14:02:10]  uglifyjs started ... 
[14:02:12]  autoprefixer: <css input>:32897:3: Gradient has outdated direction syntax. New syntax is like `to left` 
            instead of `right`. 
[14:02:12]  autoprefixer: <css input>:33082:3: Gradient has outdated direction syntax. New syntax is like `to left` 
            instead of `right`. 
[14:02:13]  sass finished in 2.60 s 
[14:02:13]  cleancss started ... 
[14:02:16]  cleancss finished in 3.27 s 
[14:02:47]  uglifyjs finished in 37.11 s 
[14:02:47]  postprocess started ... 
[14:02:47]  removed unused font files 
[14:02:47]  postprocess finished in 103 ms 
[14:02:47]  lint started ... 
[14:02:47]  build prod finished in 221.22 s 
> cordova build android
Processing settings for platform: android
Processing settings for platform: ios
Wrote iOS Plist: /Users/Eugene/Development/Repos/Pfizer/newton-miguia/platforms/ios/Mi Guia/Mi Guia-Info.plist
Discovered plugin "cordova-plugin-streaming-media" in config.xml. Adding it to the project

Fetching plugin "cordova-plugin-streaming-media@^1.0.2" via npm

Plugin "com.hutchind.cordova.plugins.streamingmedia" already installed on android.

Plugin "com.hutchind.cordova.plugins.streamingmedia" already installed on ios.

ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
Subproject Path: CordovaLib

Could not find implementations for the following rules specified in the configuration:
    comma-dangle
Try upgrading TSLint and/or ensuring that you have all necessary custom rules installed.
If TSLint was recently upgraded, you may have old rules configured which need to be cleaned up.
        
null

org.xwalk:xwalk_core_library:23+
Incremental java compilation is an incubating feature.

:preBuild
 UP-TO-DATE
:preArmv7DebugBuild
 UP-TO-DATE
:checkArmv7DebugManifest

:preArmv7ReleaseBuild UP-TO-DATE
:preX86DebugBuild
 UP-TO-DATE

:preX86ReleaseBuild
 UP-TO-DATE
:CordovaLib:preBuild
 UP-TO-DATE
:CordovaLib:preDebugBuild
 UP-TO-DATE
:CordovaLib:checkDebugManifest

:CordovaLib:prepareDebugDependencies

:CordovaLib:compileDebugAidl

:CordovaLib:compileDebugNdk
 UP-TO-DATE
:CordovaLib:compileLint

:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders

:CordovaLib:compileDebugShaders

:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets

:CordovaLib:mergeDebugProguardFiles

:CordovaLib:packageDebugRenderscript
 UP-TO-DATE
:CordovaLib:compileDebugRenderscript

:CordovaLib:generateDebugResValues

:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources

:CordovaLib:processDebugManifest

:CordovaLib:generateDebugBuildConfig

:CordovaLib:processDebugResources

:CordovaLib:generateDebugSources

:CordovaLib:incrementalDebugJavaCompilationSafeguard

:CordovaLib:compileDebugJavaWithJavac

:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes
 
UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

:CordovaLib:mergeDebugJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

:CordovaLib:bundleDebug

:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest

:CordovaLib:prepareReleaseDependencies

:CordovaLib:compileReleaseAidl

:CordovaLib:compileReleaseNdk
 
UP-TO-DATE
:CordovaLib:copyReleaseLint
 UP-TO-DATE
:CordovaLib:mergeReleaseShaders

:CordovaLib:compileReleaseShaders

:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets

:CordovaLib:mergeReleaseProguardFiles

:CordovaLib:packageReleaseRenderscript
 UP-TO-DATE
:CordovaLib:compileReleaseRenderscript

:CordovaLib:generateReleaseResValues

:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources

:CordovaLib:processReleaseManifest

:CordovaLib:generateReleaseBuildConfig

:CordovaLib:processReleaseResources

:CordovaLib:generateReleaseSources

:CordovaLib:incrementalReleaseJavaCompilationSafeguard

:CordovaLib:compileReleaseJavaWithJavac

:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes
 
UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease

:CordovaLib:mergeReleaseJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForRelease

:CordovaLib:transformNative_libsWithSyncJniLibsForRelease

:CordovaLib:bundleRelease

:prepareAndroidArchLifecycleRuntime100Library

:prepareAndroidCordovaLibUnspecifiedDebugLibrary

:prepareComAndroidSupportAnimatedVectorDrawable2531Library

:prepareComAndroidSupportAppcompatV72531Library

:prepareComAndroidSupportCardviewV72531Library

:prepareComAndroidSupportSupportCompat2700Library

:prepareComAndroidSupportSupportCoreUi2700Library

:prepareComAndroidSupportSupportCoreUtils2700Library

:prepareComAndroidSupportSupportFragment2700Library

:prepareComAndroidSupportSupportMediaCompat2700Library

:prepareComAndroidSupportSupportV42700Library

:prepareComAndroidSupportSupportVectorDrawable2531Library

:prepareComGoogleAndroidGmsPlayServicesAnalytics1142Library

:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1142Library

:prepareComGoogleAndroidGmsPlayServicesAnalyticsImplLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesAnalyticsLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesBase1142Library

:prepareComGoogleAndroidGmsPlayServicesBaseLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesBasement1142Library

:prepareComGoogleAndroidGmsPlayServicesBasementLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesGcm1142Library

:prepareComGoogleAndroidGmsPlayServicesGcmLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesIid1142Library

:prepareComGoogleAndroidGmsPlayServicesIidLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesLocation1142Library

:prepareComGoogleAndroidGmsPlayServicesLocationLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1142Library

:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4ImplLicense1142Library

:prepareComGoogleAndroidGmsPlayServicesTasks1142Library

:prepareComGoogleAndroidGmsPlayServicesTasksLicense1142Library

:prepareComUrbanairshipAndroidUrbanairshipSdk882Library

:prepareOrgXwalkXwalk_core_library23535894Library

:prepareArmv7DebugDependencies

:compileArmv7DebugAidl

:compileArmv7DebugRenderscript

:generateArmv7DebugBuildConfig
:mergeArmv7DebugShaders

:compileArmv7DebugShaders

:generateArmv7DebugAssets
:mergeArmv7DebugAssets

:createXwalkCommandLineFileArmv7Debug

:generateArmv7DebugResValues

:generateArmv7DebugResources

:mergeArmv7DebugResources

:processArmv7DebugManifest

/Users/Eugene/Development/Repos/Pfizer/newton-miguia/platforms/android/AndroidManifest.xml:72:9-82:20 Warning:
	activity#com.urbanairship.cordova.CustomLandingPageActivity was tagged at AndroidManifest.xml:72 to replace another declaration but no other declaration present
:processArmv7DebugResources
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> 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: 26.079 secs
Error: /Users/Eugene/Development/Repos/Pfizer/newton-miguia/platforms/android/gradlew: 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:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> 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.

[ERROR] An error occurred while running cordova build android (exit code 1).
        
Eugenes-MacBook-Pro:newton-miguia Eugene$ 
1 Like

Are you all using Crosswalk in the projects that can’t build any more?

(Simple reply with “Yes” or “No” would be important)

How can I determine this?

1 Like

Yes, I am. Trying to remove modules and remove Crosswalk to check if this solve the problem.

1 Like

You would have a plugin cordova-plugin-crosswalk-webview (or similar) in use.

Yes Crosswalk is in this project. But I also added the cordova-plugin-crosswalk-webview to a fresh project and that built OK

2 Likes

Can you guys provide a list of plugins you guys using? I am starting to think that is a problem in some particular plugin, because this error is not reproduced in a fresh installation.

In my case are:

<plugin name="com-sarriaroman-photoviewer" spec="^1.1.10" />
<plugin name="com.synconset.imagepicker" spec="^2.1.10">
    <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="Precisamos acessar suas fotos para coletar o documento." />
</plugin>
<plugin name="cordova-plugin-camera-preview" spec="0.9.0">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="Precisamos acessar para a selfie e a coleta de documentos." />
</plugin>
<plugin name="cordova-plugin-crop" spec="0.4.0" />
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-file" spec="^4.3.3" />
<plugin name="cordova-plugin-geolocation" spec="^2.4.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
<plugin name="cordova-plugin-screen-orientation" spec="2.0.2-dev" />
<plugin name="cordova-plugin-sim" spec="^1.3.3" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-vibration" spec="^2.1.5" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="onesignal-cordova-plugin" spec="^2.2.0" />
1 Like
$ ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.15.1
    ionic (Ionic CLI) : 3.15.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 25.2.5
    ios-deploy        : 2.0.0
    ios-sim           : 6.0.0
    Node              : v8.6.0
    npm               : 5.3.0
    OS                : macOS High Sierra
    Xcode             : Xcode 9.1 Build version 9B37

Environment Variables:

    ANDROID_HOME : /Users/mhartington/Library/Android/sdk

Misc:

    backend : pro

So i was able to start a new project and with the default plugins + crosswalk, was able to build without an issue.
I think @leonardoss could be on to something as these errors:

ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight

Are not reproducible in fresh app

1 Like

This seem to be from the android studio 3.0 update/release.

Until cordova-android 6.4.0 is out, I suggest everyone downgrade the android studio version to something before 3.0

https://android-studio.en.uptodown.com/mac/old

Same for me!
I downgraded ionic to 3.15.0 but same error.
cli packages: (/Volumes/iMatt HD/develop/mobile/ionic/upel/node_modules)

@ionic/cli-utils  : 1.15.0
ionic (Ionic CLI) : 3.15.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.1

System:

Android SDK Tools : 26.1.1
ios-deploy        : 1.9.1
ios-sim           : 5.0.13
Node              : v6.11.4
npm               : 3.10.10
OS                : macOS High Sierra
Xcode             : Xcode 9.0.1 Build version 9A1004

Environment Variables:

ANDROID_HOME : /Users/matt/Library/Android/sdk

Misc:

backend : pro

Managed to build finally,

I downgraded to ionic (Ionic CLI) : 3.13.1 and upgraded cordova-android to 6.3.0 which cleared the FontFamilyError but resulted in a different one:

Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/BuildHelper;

However to fix that, this worked:

cordova plugin rm cordova-plugin-compat --force
cordova platform rm android
cordova platform add android@6.3.0

which I found here.
https://cordova.apache.org/announcements/2017/09/27/android-release.html#comment-3563629128

2 Likes

@leonardoss I had to set ANDROID_HOME too to my SDK folder

I am at Android Studio 2.3.3, at this moment the problem is with Support revision 27.0.0, if some plugin require AppCompat wiht + operator, it will install latest revision with a values.xml file that contains the tag:

com.android.support:support-v4:+

After build, the file is ‘platforms\android\build\intermediates\exploded-aar\com.android.support\support-compat\27.0.0\res\values\values.xml’

and the code that is causing the issue is (line 7):

<declare-styleable name="FontFamily"><attr format="string" name="fontProviderAuthority"/><attr format="string" name="fontProviderPackage"/><attr format="string" name="fontProviderQuery"/><attr format="reference" name="fontProviderCerts"/><attr name="fontProviderFetchStrategy">
            
            <enum name="blocking" value="0"/>
            
            <enum name="async" value="1"/>
        </attr><attr format="integer" name="fontProviderFetchTimeout">
          
            <enum name="forever" value="-1"/>
        </attr></declare-styleable>
    <declare-styleable name="FontFamilyFont"><attr name="fontStyle">
            <enum name="normal" value="0"/>
            <enum name="italic" value="1"/>
        </attr><attr format="reference" name="font"/><attr format="integer" name="fontWeight"/><attr name="android:fontStyle"/><attr name="android:font"/><attr name="android:fontWeight"/></declare-styleable>

I am trying to fix the version of appcompat in my project.properties file inside android platform project.

That is very strange because the file seems not well idented, maybe someone dropped this code in the file by mistake.

1 Like

My ionic info and cordova requirements

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.1

global packages:

    cordova (Cordova CLI) : 6.5.0 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.3.0 ios 4.3.1
    Ionic Framework    : ionic-angular 3.3.0

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.1 
    ios-sim           : 6.0.0 
    Node              : v8.2.1
    npm               : 5.3.0 
    OS                : macOS Sierra
    Xcode             : Xcode 9.0.1 Build version 9A1004 

Misc:

    backend : legacy
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-22,android-21,Google Inc.:Google APIs:21,android-19,android-18,android-16
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 9.0.1
ios-deploy: installed 1.9.1
CocoaPods: installed 

@yoojene can you post the content of your project.properties file, you can find it inside platforms/android (root folder).