[SOLVED] Execution failed for task ‘:mergeDebugResources’

Hi guys,

I am running the ionic cordova build android and getting this error:

:mergeDebugResources
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

* 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: 49.569 secs
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.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Could you please help me with this?
Thanks in advance.


ionic info

global packages:

@ionic/cli-utils : 1.1.2
Cordova CLI      : 7.0.1
Ionic CLI        : 3.1.2

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework                 : ionic-angular 3.2.1

System:

Node       : v6.9.4
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

Android project created with cordova-android@6.2.3

5 Likes

check out this discussion

Hi, @vnyksj .

It works. What I do is remove all the icon and splash image inside the ./resources/android (broken image maybe).
Then generate again by running ionic cordova resources and build it again.

Thanks a lot.

14 Likes

This solution isnt working for me.

I removed both ios and android folders in resources and then used the command ionic cordova resources to generate resources again.

Then I tried ionic cordova run android but it generates below errors:

I am trying it with very basic project generated using command ionic start MyProject blank, no additional plugin installed no custom code added just default project.


:mergeDebugResources

Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
:mergeDebugResources FAILED

BUILD FAILED

Total time: 1.625 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

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

ionic info


global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.9.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Any help would be really appreciated.

I have the same problem

2 Likes

Even i had it but did followings to fix it
Delete the icon files under android resources folder then run the command
ionic cordova resources --icon
then ran fine :slight_smile:

Wow my God! This is true. OK for me!

Yes problem occurs with the images in both icon and splash folders. What i did was copy from another working icon and splash folder and it works. Thanks fikrie_uno.

thanks, it works for me

Man you save my life, help a lots kkkk Thank really Thank

it works for me too.
First you should input ionic cordova resorces and then
ionic cordova build android, that will create the apk for install in your phone

Hello guys,
I had this same project when developing an application.
I tried everything I saw on the web and nothing fixed the problem.
So I had the idea to stop the protection of my antivirus, and only then I was able to build it successfully.
Try this, pause the antivirus and again run the command: ionic cordova run android.
Thanks a lot.

1 Like

Don’t know why but deleting all resources and regenerating with ionic cordova resources solved it. Thanks guys!

Yes, the real culprit in my case.
I wasted my whole day on this.

  • Uninstalled native plugins
  • Deleted my build-tool 27.0.3 (since aapt.exe file was deleted by my m*** f** antivirus)
  • Reinstalled build-tools
  • Removed my resources
    so on…

I owe you a handshake @rafaelfilholm :slight_smile:

Removed the android folder - just deleted it
then run android again…
Happened twice today.
Any way to stop it?

hiiiiii fnds
project name is small not big word mostly problem solve…

Thank you… It solved my problem