Fix “Execution failed app:processDebugResources” in Android Studio
Resources are the files and static content that the application’s code uses, such as animations, images, layouts, and string values. These files stored in the resource directory can be referenced from the application’s code but when a non-existent reference is called android throws an “Execution failed app:processDebugResources” error. In this article, we will be discussing 5 different methods to solve this error.
- Method 1: Change the version of buildTools
- Method 2: Run Gradle with –stacktrace
- Method 3: Add required libraries
- Method 4: Clean project
- Method 5: Invalid Caches/Restart
Method 1: Change the version of buildTools
If the android SDK corresponding to the buildToolsVersion used in the app is not installed, make sure to change the buildToolsVersion to the latest Android SDK Build Tools version already installed.
Step 1: Navigate to Tools > SDK Manager
Step 2: Navigate to SDK Tools & click “Show Package Details” and look for the latest version of the Android SDK Build Tools Version installed.
Step 3: Navigate to app > Gradle Script > build.gradle (Module:app) and make sure the buildToolsVersion is the same as the latest version of the build tools already installed.
Step 4: Sync the project to solve the issue.
Method 2: Run Gradle with –stacktrace
(a) Make sure not to give any references to a non-existent string in the resources. A reference to a string not defined in the strings.xml file can cause this error.
(b) Make sure to follow the naming conventions in the layout, strings, color, attrs, styles, drawable, and various directories in the resources folder.
To find out what’s exactly causing the error, we can use the –stacktrace command.
Step 1: Navigate to File > Settings.
Step 2: Navigate to Build, Execution, Deployment > Compiler and add “–stacktrace” in Command-line Options.
Step 3: Click Apply and OK.
Method 3: Add required libraries
If you are running a 64-bit version of Ubuntu, install the 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
If you are running 64-bit Fedora, install the libraries with the following command:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
To find out how to add these libraries, please visit the official website https://developer.android.com/studio/install
Method 4: Clean Project
A clean project removes the build artifacts and recompiles the project again, thereby solving the issue. Navigate to Build > Clean Project
Method 5: Invalid Caches/Restart
The only way to solve some errors is to clean out the cached data which can be done by Navigating to File > Invalidate Caches/Restart > Invalidate Cache and Restart.