Skip to content

Execution failed for task ':app:mergeReleaseResources'. > java.util.concurrent.ExecutionException #1394

Closed

Description

@sebj54

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.3.2
  • Cross-platform modules:
  • Android Runtime: 5.3.1

Dependencies:

┌────────────────────────────────┬─────────┐
│ Plugin                         │ Version │
│ @exeleon/nativescript-svg      │ ^1.0.1  │
│ intl                           │ ^1.2.5  │
│ nativescript-bubble-navigation │ ^1.0.3  │
│ nativescript-cardview          │ ^3.1.1  │
│ nativescript-directions        │ ^1.3.0  │
│ nativescript-geolocation       │ ^5.0.0  │
│ nativescript-google-maps-sdk   │ ^2.7.0  │
│ nativescript-localize          │ ^4.1.1  │
│ nativescript-plugin-firebase   │ ^8.3.2  │
│ nativescript-stripe            │ ^5.1.0  │
│ nativescript-theme-core        │ ^1.0.4  │
│ nativescript-ui-sidedrawer     │ ^6.0.0  │
│ nativescript-vue               │ ^2.2.2  │
│ tns-core-modules               │ ^5.0.2  │
│ vuex                           │ ^3.0.1  │
└────────────────────────────────┴─────────┘

Dev Dependencies:

┌────────────────────────────────────┬─────────┐
│ Plugin                             │ Version │
│ @babel/core                        │ ^7.0.0  │
│ @babel/preset-env                  │ ^7.0.0  │
│ @vue/cli-plugin-eslint             │ ^3.5.1  │
│ @vue/cli-service                   │ ^3.5.3  │
│ @vue/eslint-config-airbnb          │ ^4.0.0  │
│ babel-eslint                       │ ^10.0.1 │
│ babel-loader                       │ ^8.0.2  │
│ babel-traverse                     │ 6.26.0  │
│ babel-types                        │ 6.26.0  │
│ babylon                            │ 6.18.0  │
│ clean-webpack-plugin               │ ^0.1.19 │
│ copy-webpack-plugin                │ ^4.5.2  │
│ css-loader                         │ ^1.0.0  │
│ eslint                             │ ^5.8.0  │
│ eslint-plugin-vue                  │ ^5.0.0  │
│ lazy                               │ 1.0.11  │
│ nativescript-dev-sass              │ ^1.7.0  │
│ nativescript-dev-webpack           │ next    │
│ nativescript-vue-template-compiler │ ^2.0.0  │
│ nativescript-worker-loader         │ ~0.9.0  │
│ node-sass                          │ ^4.9.2  │
│ sass-loader                        │ ^7.1.0  │
│ terser-webpack-plugin              │ ^1.1.0  │
│ vue-loader                         │ ^15.2.6 │
│ vue-template-compiler              │ ^2.6.10 │
│ webpack                            │ ^4.16.4 │
│ webpack-bundle-analyzer            │ ~2.13.1 │
│ webpack-cli                        │ ^3.1.0  │
└────────────────────────────────────┴─────────┘

Describe the bug

When I run a release build, I get this error:

Gradle build...
         + setting applicationId
         + applying user-defined configuration from C:\Users\sebas\projets\energy-bank-app\app\App_Resources\Android\before-plugins.gradle
         + applying user-defined configuration from C:\Users\sebas\projets\energy-bank-app\app\App_Resources\Android\app.gradle
         + using support library version 28.0.0
         + adding nativescript runtime package dependency: nativescript-optimized
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\@exeleon\nativescript-svg\platforms\android\androidsvg-release.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-bubble-navigation\platforms\android\bubblenavigation-release.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-bubble-navigation\platforms\android\nativescript_bubble_navigation.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-geolocation\platforms\android\nativescript_geolocation.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-google-maps-sdk\platforms\android\nativescript_google_maps_sdk.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-plugin-firebase\platforms\android\firebase-release.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-plugin-firebase\platforms\android\nativescript_plugin_firebase.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-ui-sidedrawer\platforms\android\TNSSideDrawer-release.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\nativescript-ui-core\platforms\android\TNSCore-release.aar
         + adding aar plugin dependency: C:\Users\sebas\projets\energy-bank-app\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
AAPT2 aapt2-3.3.2-5309881-windows Daemon #1: Unexpectedly exit.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.2-5309881-windows Daemon #1: Unexpected error during compile 'C:\Users\sebas\projets\energy-bank-app\platforms\android\app\src\main\res\drawable-xxxhdpi\background.png', attempting to stop daemon.
  This should not happen under normal circumstances, please file an issue if it does.

It worked as expected before, but since I changed the default background.png files, I get this error when building in release mode with this command :

tns build android --bundle --release --key-store-path upload-key.keystore --key-store-password *** --key-store-alias upload-key --key-store-alias-password *** --aab

Maybe I did something wrong with the files but I already checked the dimensions of the picture, which are exactly the same than the default ones.

To Reproduce

I'm not sure how to reproduce exactly this error. I can try to create a project from scratch, add my background files and see if I can reproduce (if you think it will help!).

I also checked this issue (#1094). I don't know if is still applicable. I don"t have a special character in my path, so I don't think it is the same issue. I would like to keep AAPT2 if possible.

Thanks for your help on this!

Activity

  1. changed the title [-]il.concExecution failed for task ':app:mergeReleaseResources'. > java.uturrent.ExecutionException[/-] [+]Execution failed for task ':app:mergeReleaseResources'. > java.util.concurrent.ExecutionException[/+] on Jun 12, 2019
  2. vtrifonov commented on Jun 13, 2019

    @vtrifonov
    Contributor

    Can you try adding the same background file to a newly created app to see whether you can reproduce it?

  3. vtrifonov commented on Jun 13, 2019

    @vtrifonov
    Contributor

    Seems like you are hitting android gradle plugin issue https://stackoverflow.com/questions/52712063/build-failing-during-merge-resources-with-android-gradle-plugin-3-3-0, you can try with the suggested fix there, tns-android 5.4.0 used android gradle plugin version 3.4.0 but it seems that the issue is not yet fixed there.

  4. sebj54 commented on Jun 13, 2019

    @sebj54
    ContributorAuthor

    @vtrifonov Thank you for your help, I figured it out!

    I misread my package.json file… My android runtime version was 5.3.1 and not 5.4.0 🤦‍♂

    I updated it to 5.4.0 using tns platform update android@5.4.0, deleted my platforms folder and retriggerred the build. Now it works perfectly!

    The problem was certainly my xxxhdpi background file which was over 2MB.

    Thanks for all your amazing work on this plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions