Cordova Vuejs Android build encountered an error (Task ':app:processDebugResources' execution failed)

When I attempted to run Cordova on my Android device using "cordova run android / cordova build", I encountered the following error:

FAILURE: Build failed with an exception.

  • What caused the issue: Execution failed for task ':app:processDebugResources'. Failed to execute aapt

Does anyone have any ideas on how to resolve this? I already tried build/clean but it didn't work.

Thank you in advance.

Answer №1

After experiencing two days of challenges due to the recent update of "android X" for firebase libraries:

https://developer.android.com/jetpack/androidx/migrate

The solution is as follows: Make sure to do the following:

  • Upgrade com.android.tools.build:gradle to version 3.2.1 or later.
  • Upgrade compileSdkVersion to 28 or later. Update your app to use
  • Jetpack (AndroidX); refer to the instructions in Migrating to AndroidX.

For a Cordova project, simply add the following plugins:

These plugins will resolve build errors and ensure everything functions smoothly :)

Answer №2

To prevent automatic updates for specific services in your Android project, simply add the following code block to the build-extras.gradle file inside the platform/android folder:

configurations.all {
    resolutionStrategy {
         force 'com.android.support:support-v4:27.1.1'
         force 'com.google.android.gms:play-services-tagmanager:16.0.8'
         force 'com.google.android.gms:play-services-base:16.1.0'
         force 'com.google.android.gms:play-services-tasks:16.0.1'
         force 'com.google.android.gms:play-services-basement:16.2.0'
         force 'com.google.android.gms:play-services-gcm:16.1.0'
         force 'com.google.android.gms:play-services-stats:16.0.1'
         force 'com.google.android.gms:play-services-location:16.0.0'
         force 'com.google.android.gms:play-services-auth:16.0.1'
         force 'com.google.android.gms:play-services-identity:16.0.0'
    }
}

This will ensure that the build process uses the specified versions of these services instead of automatically updating them.

There's no need to modify any plugins or change the android platform version when using this method :)

PS It can be frustrating when Firebase libraries are updated automatically. Unfortunately, disabling auto dependency updates during the build command may not be possible at this time.

Answer №3

Encountering a similar issue, I built on Friday without any trouble but faced an error 'Execution failed for task': app: processDebugResources' when attempting the build on Monday. The error included a stacktrace on Aapt2Exception: AAPT2 error.

It seems that this problem is related to Google releasing new versions of support-v4 and api-level updates.

According to this source, installing the cordova-android-support-gradle-release plugin can resolve the issue.

Add the following code snippet in the build.gradle file located in the platforms/android directory:
configurations.all {
    resolutionStrategy.force 'com.android.support:support-v4:27.1.0'
}

While this solution didn't work for me, there might have been an error in my implementation. Hopefully, it resolves your issue.

--- UPDATE 1

Google recently updated the Google Play service libraries and Firebase on June 17, 2019, which could be directly linked to our problem. They suggest the following modifications:

  • Upgrade com.android.tools.build:gradle to v3.2.1 or higher.
  • Increase compileSdkVersion to 28 or later.
  • Transition your app to use Jetpack (AndroidX); follow the guidelines in Migrating to AndroidX.

In the case of Cordova applications, implementing these changes may not be straightforward, especially during a release cycle update. This situation can be frustrating.

--- UPDATE 2

To address the issue temporarily, I edited the project.properties file within the platforms/android directory.

I revised all the libraries marked with "+" to a specific version before the one released on the 17th. Refer to this link, although this method is not ideal as the file might get deleted during platform removal and re-inclusion.

--- UPDATE 3

As pointed out by Leonardo, this issue arises due to the updates in firebase and play service libraries alongside automatic cordova dependency updates. Resolving this involves using the configurations.all code in a build-extras.gradle file at the project's root directory + employing hooks for automating the setup copy to the platform/android directory as detailed in this resource.

PS: Apologies for any grammatical errors in English.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Obtain the abbreviated name of the administrative area in Android using the Geocoder

When utilizing the google maps API, for the administrative area it provides both the long name and short name. For example: { "long_name": "Victoria", "short_name": "VIC", "types": [ "administrative_area_level_1", "political" ...

Unforeseen outcomes of JavaScript when using the let and var keywords

In JavaScript, when using the var keyword to declare a variable, the JS engine assigns a default value of "undefined" at creation stage. console.log(message); // undefined var message = "My message"; However, with the let keyword: console.log(message); ...

Tips for asynchronously updating a model in TypeScript

I have been working on a function to hide the element for connecting to Facebook upon successful connection. I have implemented two functions, success and error, which trigger after Firebase successfully logs in the user. While I can confirm that these fun ...

Having trouble with installing NPM and ng commands, neither of them is working. I may have to uninstall everything and begin from scratch

Learning Angular and how to use the terminal is all new to me. I recently installed NPM and attempted to use ng serve, but encountered a series of issues. At this point, I am considering completely uninstalling everything so I can start fresh. I've d ...

Exploring Angular2's ability to interpret directive templates using the ng-container

Recently delving into angular2, I ventured into creating dynamic forms and generating fields by following the guide provided in this URL. The result was as expected. The dynamic form component renders each field one by one using ng-container, like shown b ...

Transform HTML tables into DataTables using jQuery

I am trying to convert a table into a "dataTables jQuery" format (tbody, thead...), but I'm not sure how to do it using jQuery. Below is my current table structure which is generated as a string in C#: <table cellspacing="0" rules="all" border=" ...

What is the reason behind this being deemed as true?

Imagine we have this snippet of code: var attachRed = false; Why is attachRed = !attachRed equivalent to true? I'm curious because I'm working with Vue.js and trying to grasp why this particular piece of code functions as it does. <div id= ...

Having trouble with an unknown cipher when using the crypto module?

Encountering difficulty encrypting with aes-256 using cipher - getting an error stating unknown cipher. Any insights on what may be missing in the code below? index.js function encryptPaymentId(specialtyID, paymentId) { const convertToStrin ...

What is the best way to display the names of students whose grade exceeds 70% using JavaScript?

I am currently utilizing the json-rule-engine library, which can be found at https://www.npmjs.com/package/json-rules-engine. In my scenario, I have a list of students with their names and corresponding percentages. Additionally, there is a specific busine ...

Problem with the functionality of the "toggled" attribute in redux-form-material-ui

Currently, I am attempting to implement Toggle functionality from redux-form-material-ui: import { Toggle } from 'redux-form-material-ui' When the toggle value changes, it successfully updates in the store upon onChange: <Col xs='3&apo ...

What is the equivalent of window.onload in emscripten?

In my HTML file, I have been copying and pasting the Emscripten generated code into the <script></script> region. However, the browsers tend to execute the Emscripten code before the entire HTML file has been processed. This causes issues if ...

Unveiling the Mystery: Extracting the URL Parameter in AngularJS

Here is a link localhost/project/#/showprofile/18 I need to retrieve the parameter 18 in my view In the application file named app.js, I have the following configuration: .when('/showprofile/:UserID', { title: 'Show User Profile&apo ...

The error message states that the object #<MongoClient> does not have the method 'db'

Learning node.js, mongodb, express has been quite challenging for me, especially when it comes to setting up the database. Here is a snippet of my code (app.js): var express = require('express'), app = express(), cons = require('co ...

Trigger price update in jquery based on radio or checkbox selection and specific conditions

https://i.sstatic.net/OIvgF.png In my product form, I have implemented a feature where selecting the "product type" and "product size" will update the price. However, if the user changes the product type after selecting the size, the price does not update ...

The React server-side rendering isn't reflecting changes made on the client-side route

Upon the first refresh, both the server and client side are updated; however, subsequent updates only affect the client side when switching pages with react router. For instance, refreshing the page or entering a new URL causes changes on the server and t ...

Switching icon images using JQuery based on state changes

I'm attempting to switch the background image of my webpage's "body" element when the user toggles between playing and pausing music icons. This is what the CSS for the "body" element looks like: body { background: url('https://s3-us-wes ...

In JavaScript, a "switch statement" retrieves a test value from a "input type text" by accessing the value using getElementByName.value

Attempting to test 7 possible values for the variable 'a' by passing it to a function from user input in seven 'input type text' boxes, then checking each value individually with clicks on 7 'input type image' elements. Howeve ...

The delete function wipes out all child elements, rather than specifically targeting the one associated with the key

After extensive research on this topic, I am still struggling to get the 'Remove' button in my child component (ControlledOpenSelect) to only remove the item with the specific key it was passed through the callback function. Take a look at my Co ...

Tips for incorporating additional items into an established useState array utilizing map() or foreach()?

I'm working on developing a social media platform similar to Twitter, and I'm facing challenges with the news feed functionality. Essentially, the news feed is supposed to fetch tweets from my firebase database for each user followed by the curre ...

Utilize the content within an input field to perform a calculation and showcase the outcome in a separate element

Currently, my shopping cart displays a price, quantity, and subtotal field for each product. While the user can change the quantity field, the other fields remain static. I am looking for a method to automatically calculate the subtotal whenever the user ...