-1

I am new to Android Studio I just opened a template as normal as anybody can do when first open android studio, I didn't edit anything I just tried to build the apk and got that error, can someone help?

Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #8: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #6: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #5: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #7: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #12: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #9: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #11: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.0.1-6197926-linux Daemon #10: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.```
7Wdev
  • 47
  • 7
  • Duplicate? https://stackoverflow.com/questions/23359572/android-studio-execution-failed-for-task-appmergedebugresources-if-projec – TomTom Jul 29 '20 at 23:23
  • Not duplicating there is some difference between my error and his error – 7Wdev Jul 29 '20 at 23:53

2 Answers2

0

Try following options:

  1. clean & rebuild your project
  2. Restart the android studio
  3. Try Invalidate caches and restart
  4. Delete C:\Users\{username}\.gradle\caches folder and restart Android studio
  5. Check and Update your android gradle plugin version

Also check your gradle.properties contain below line or not.

org.gradle.jvmargs=-Xmx4608m
Dhruv
  • 1,862
  • 3
  • 20
  • 38
0

Spent weeks on and off with an AAPT2 error: no such file or directory despite the file concerned being present and not malformed/corrupt (the underlying problem in all the solutions I found online)

I finally discovered that AAPT2 uses the mmap() C library call to map resources into memory for the merge process (AAPT did not.)

My projects were on a network share (SSHFS), which caused an mmap error the AAPT2 code was not expecting, resulting in the inaccurate error message.

The only solutions I could find were:

  1. Don't use a network share (who needs networks right?)

  2. Rewrite AAPT2 to not use mmap.

Gass
  • 7,536
  • 3
  • 37
  • 41
AndyT
  • 81
  • 9