1

At first install running a program all is normal. And then it's happened since I add a splash screen in there. I've reinstalled the application but nothing was changed. First run normal and the second run is failed again. I try to check my gradle and the file, but no one problem that found in there.

How I can fix this problem?

Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:_internal_aapt2_binary'. Failed to transform aapt2-4.1.2-6503028-windows.jar (com.android.tools.build:aapt2:4.1.2-6503028) to match attributes {artifactType=_internal-android-aapt2-binary, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}. > Execution failed for Aapt2Extractor: C:\Users\ASUS.gradle\caches\modules-2\files-2.1\com.android.tools.build\aapt2\4.1.2-6503028\6d9042942daa27a40e3ff66254cb2a82a7f0b69f\aapt2-4.1.2-6503028-windows.jar. > Failed to create directory 'C:\Users\ASUS.gradle\caches\transforms-2\files-2.1\0acdb043263d98cb86ad08d6f4b1bd1a\aapt2-4.1.2-6503028-windows'

Sethuraman Srinivasan
  • 1,528
  • 1
  • 20
  • 34
  • Does this answer your question? [Execution failed for task :':app:mergeDebugResources'. Android Studio](https://stackoverflow.com/questions/22583418/execution-failed-for-task-appmergedebugresources-android-studio) – Sethuraman Srinivasan Mar 19 '21 at 03:18

1 Answers1

0

Cannot isolate the issue but you can try these things if the caches got scrambled or something

  1. try clean build or invalidate caches/restart

  2. If the above didn't work delete the build/caches folder and rerun. From what I can see you can go here C:\Users\ASUS.gradle\caches and delete the caches folder, this will most certainly resolve your issue.

  3. If that also didn't work the ultimate resort would be nuking the caches

  • Close Android Studio
  • open terminal and go to project location (cd project location)
  • ./gradlew clean
  • ./gradlew --stop
  • rm -rf ~/.gradle/caches
  • ./gradlew assembleDebug
  • Open Android Studio and gradle sync

I hope it works.

Anil Demir
  • 41
  • 9
  • Unable to delete directory 'C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\0acdb043263d98cb86ad08d6f4b1bd1a' Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory. - C:\Users\ASUS\.gradle\caches\transforms-2\files-2.1\0acdb043263d98cb86ad08d6f4b1bd1a\aapt2-4.1.2-6503028-windows – Cindy Magnolia Mar 19 '21 at 02:47
  • It didn't works and the output is like that :( – Cindy Magnolia Mar 19 '21 at 02:47
  • @CindyMagnolia Would you try to turn everything off? I think it happens cause of the program is running in the background. – Anil Demir Mar 19 '21 at 15:57