How to solve the ‘Execution failed for AarResourcesCompilerTransform’ issue in Android Studio Canary

Cazimir Roman
Oct 19, 2020

Recently I was migrating my skeleton MVVM project to Gradle version 4.2.0-alpha13 which I use to start every Android project out there and ran into a peculiar problem. The Android version I am using is:

Android Studio version 4.2 Canary 13

When building the project I got this error:

Execution failed for task ‘:app:processDebugResources’.
> Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’.
> Failed to transform appcompat-1.2.0.aar (androidx.appcompat:appcompat:1.2.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for AarResourcesCompilerTransform: C:\Users\xxxxxxxx\.gradle\caches\transforms-2\files-2.1\fde056b080d7a7424f0cc8d58e7acfb1\appcompat-1.2.0.
> AAPT2 aapt2–4.2.0-alpha13–6840111-windows Daemon #1: Daemon startup failed
Please check if you installed the Windows Universal C Runtime.
This should not happen under normal circumstances, please file an issue if it does.

Also Android Studio was showing me this error :

CreateProcess error=740, The requested operation requires elevation. 

I immediately knew that the AAPT process could not be started because of an elevation issue.

This is what I tried doing:

  1. Restart Android Studio Canary.
  2. Run Android Studio Canary as admin by right clicking the studio64.exe file in the bin folder and choosing ‘Run as administrator’
  3. Make sure you set compileSdkVersion and targetSdkVersion to 30 in the module build.gradle file.
Target Sdk 30

In the end I restarted my PC thinking that some resources might be freed and AAPT could run freely again using administrative privileges. It worked. The project build again and I could continue working on my project.

Hope this helps somebody.

--

--

Cazimir Roman

A curious developer with a passion for learning and creating innovative solutions to complex problems.