Execution failed app:processDebugResources Android Studio
Asked Answered
V

39

133

I'm using bitbucket so I can work with other developer but it seems that we can't get it to work flawlessly. I got this error after pulling the changes from him:

Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    E:\Program Files (x86)\Android\android-sdk\build-tools\19.0.0\aapt.exe package -f --no-crunch -I E:\Program Files (x86)\Android\android-sdk\platforms\android-19\android.jar -M E:\Documents\smart-my-job1\app\build\manifests\debug\AndroidManifest.xml -S E:\Documents\smart-my-job1\app\build\res\all\debug -A E:\Documents\smart-my-job1\app\build\assets\debug -m -J E:\Documents\smart-my-job1\app\build\source\r\debug -F E:\Documents\smart-my-job1\app\build\libs\app-debug.ap_ --debug-mode --custom-package com.smartmyjob
Error Code:
    -1073741819
Vaucluse answered 23/12, 2013 at 4:57 Comment(3)
I had this issue and it turned out I had an exceptionally long file name for a file in my assets folder.Prochronism
And also if there are non English character in file or image names you will have same problem. I discovered today.Samy
I had similar issue with processIdeDebugResources. It turned out with deleting build folder, and running app again it listed other errors.Levee
S
111

For me it helped to change the version of buildTools to:

buildToolsVersion "21.0.1"

You will find this setting inside the file app/build.gradle.

Shovel answered 19/10, 2014 at 16:47 Comment(6)
does changing this have any side effects on the actual project?Kulda
Thanks to this guy , if you still confused look to your downloaded sdk manager and see what's the latest version of Android SDK build-Tools . Then change your gradle build file to that version mine now is 22.0.1 . We are getting use to about this fragmentation between studio and Gradle :)Saucy
I am new to Android Studio, How to do this?Gasper
@MarthaJames You will find the setting inside the file app/build.gradle.Confectioner
I am having buildToolsVersion "23.0.1" its the latest. still the issue existGeomancy
Solved by: Ctrl +Shift + Alt + S: I made the build tools the same as the compile sdk which is 26.0.2.Davedaveda
L
45

You're hitting bug https://code.google.com/p/android/issues/detail?id=42752. The cause usually seems to be a reference to a nonexistent string in one of your menu resources.

Lampas answered 23/12, 2013 at 15:43 Comment(7)
Im having this issue with a dimen: String types not allowed (at 'navigation_drawer_width' with value '320p' Flurry
Thanks @Scott, To be more specific, R.java gets the error due to wrong resource name that's why is shows error.Hiroshima
In my case I have added apostrophe s ('s) to string in string.xml file. After removing it's working. It's so annoying the IDE can't show the error properly rather makes all resources out of sync..Suisse
Hit the same issue with a <string name=""> definitjon in my strings.xml file. Double that your strings.xml file is valid!Bolection
I got this error when I run command "gradle clean build --stacktrace --debug" due to missing icon files. ThanksCoitus
In my case I miss my style file.. but I refer this file.. nonexistent reference - this keyword save my problemAgminate
I just got this issue after removing unused resources. I removed a <string> which is used in an unused layout.xml. But I didn't delete the layout.xml.Pigmy
L
40

For me it was that I forgot to install the 32bit dependencies:

sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6
sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev
Liverish answered 3/7, 2015 at 9:44 Comment(3)
I was having many issues with building a simple APK on Ubuntu environment with the myApp Ionic sample in Android, installing these missing dependencies fixed my problems!Orban
Which folder did you install these, in your project folder or an Android system folder?Berkman
This question doesn't apply - 'apt-get' installs packages in the system.Liverish
A
18

aapt is 32 bit so will not execute on a 64 bit box until 32 bit architecture is enabled

dpkg --print-foreign-architectures  #  if prints nothing then below is fix

sudo dpkg --add-architecture i386  #  add a 32 bit architecture to box

sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev

it work for me.

Absher answered 10/10, 2015 at 2:35 Comment(2)
Those are necessary for Ubuntu 16.04Geisler
When you are using Ubuntu 16.04, you should install these 2 dependenciesAdeno
N
15

I had the same problem and fixed it doing a ./gradlew clean build! Give it a try and if that doesn't work, try ./gradlew --refresh-dependencies after and you should be good to go.

Novelize answered 18/5, 2015 at 12:35 Comment(0)
S
13

My answer may seem a bit too late, but i happened to come across this same error in Android Studio after upgrading the SDK to API 21. I tried all the solutions i came across here on this site and https://code.google.com/p/android/issues/detail?id=61308. Here's how i eventually resoled this error: I opened the app's gradle.build file and changed it from this:

android {
    compileSdkVersion 21
    buildToolsVersion "21.0.0"

    defaultConfig {
        applicationId "com.abundantideas.layoutsample"
        minSdkVersion 8
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }

to that:

android {
    compileSdkVersion 21
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.abundantideas.layoutsample"
        minSdkVersion 8
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }

I lowered the buildToolsVersion and the targetSdkVersion values back to 20 which i knew was working fine before the upgrade. It looks like API 21 was causing problems for Gradle, in my case. I hope this will help others too.

Sumikosumma answered 19/10, 2014 at 9:57 Comment(0)
T
9

In my case, I cleaned the project (Menubar -> Build -> Clean Project) and then did the build again. It worked.

Transition answered 11/5, 2016 at 9:7 Comment(1)
underrated answerBlessington
R
6

In my case i had two declaration of

<?xml version="1.0" encoding="utf-8"?>

in my vector drawable icon

all i had to do was delete one

Reprise answered 2/10, 2018 at 16:51 Comment(0)
T
3

In my Case Problem solved with Instant Run Disable in Android Studio 3.1.2 Android Instant Raun Disable

Tacmahack answered 6/5, 2018 at 7:45 Comment(0)
F
2

I encountered Execution failed app:processDebugResources Android Studio after upgrading SDK repository. I use Android Studio 1.5.1, target SDK version 23. I was using buildToolsVersion 21.0.1 previously, changing buildToolsVersion to 21.1.2 solved my problem.

You might want to how I find version 21.1.2 suitable. It was recommended by Android Studio after successfully upgraded my SDK.

enter image description here

After changing buildToolsVersion to 21.1.2 (refer to my version settings below), you need to synchronize your Gradle build mechanism.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "mm.weboffice"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
    compile 'com.android.support:support-v4:23.0.1'
}

Android Studio will prompt you to sync Gradle or you can go to "menubar > File > Synchronize" to trigger synchronization manually. Android Studio will rebuild your project after the synchronization.

enter image description here

I know there are many issues with the SDK database and configuration, my proposed solution may not fix all problems. But if you encounter the similar error after upgrading SDK repository, I hope my post solve your hassle. Good luck!

Footwork answered 21/2, 2016 at 5:0 Comment(1)
This is a well written answer, but please don't copy and paste the exact same thing to multiple answers.Slangy
E
2

In my case I tried to change buildToolsVersion in gradle, but it didn't help me. My problem was fixed when I found drawable which called example.PNG. It should be example.png; There were no messages about wrong resource name, but after I renamed file, gradle built project fine.

Exsanguine answered 22/3, 2016 at 9:40 Comment(0)
U
2

If it is not your build tools, check your strings, styles, attrs, ... XML files and ensure they are correct. For example a string with an empty name-attribute

<string name="">Test"</string>

or a previously undefined attr without a format specified (attrs.xml):

<declare-styleable name="MediaGridView">
    <attr name="allowVideo"/>
</declare-styleable>
Upsydaisy answered 27/10, 2016 at 14:56 Comment(0)
I
2

Run gradle with --stacktrace option to see more information, what's wrong.

Increase answered 8/6, 2017 at 18:1 Comment(0)
H
2

Banged my head around this for 2 days.

TL;DR - Got this error since My app name contained '-'.

Turn out android does not allowed that. After running gradlew build --stacktrace inside android directory - got an error that implies that.

Hurwitz answered 18/12, 2017 at 16:5 Comment(0)
V
2

it may help in the android studio 3.2.1 app build gradle it should be like

android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "com.sample.mvphelloworld"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
       implementation fileTree(dir: 'libs', include: ['*.jar'])
       compile 'com.android.support:appcompat-v7:27.1.1'
       implementation 'com.android.support.constraint:constraint-layout:1.1.3'
       testImplementation 'junit:junit:4.12'
       androidTestImplementation 'com.android.support.test:runner:1.0.2'
       androidTestImplementation 'com.android.support.test.espresso:espresso- 
       core:3.0.2'
}

Gradle to 4.6
plugin version to 3.2.1

Vasty answered 25/10, 2018 at 5:42 Comment(0)
A
1

Getting this error, I did a build with --info (gradle --info build). It reported that it could not open libz.so.1, due to wrong ELFCLASS. It needs a 32 bit version of libz. I had to download the source, change the Makefile to gcc -m32, and install the 32 bit glibc development package (dnf install glibc-devel.i686). After making and installing this 32 bit library, I disabled the 64 bit one.

Then all went well.

Atmo answered 17/2, 2016 at 14:23 Comment(0)
M
1

I had the same problem, and since this question was the first hit on google, I'll add my solution too. For me, it was a missing format attribute in an attr element in res/values/attrs.xml.

Morn answered 26/4, 2016 at 23:57 Comment(0)
L
1

This worked for me just by restarting android studio 2 times :D. I'm using Android Studio 2.1.

Lafayette answered 4/6, 2016 at 4:57 Comment(0)
P
1

I solved it by changing build tools version 21.0.1 to 20.0.0

Preachy answered 14/7, 2016 at 3:43 Comment(0)
T
1

I have removed all folder inside \app\build\ folder and run again it works for me.

E:\AndroidData\mobile-app\AwesomeProject\android\app\build

Tympanic answered 10/7, 2018 at 12:47 Comment(0)
A
0

In my case, crashlytics (Fabric.io) was generating files that conflicted at some point and a second file was automatically generated with an invalid name.

Long story short: Check if you don't have any filenames with invalid lengths, you should be warned above the original exception.

Amorphous answered 26/8, 2015 at 21:26 Comment(0)
A
0

I got this problem after deleting the logs I resolved this by rebuilding the project

Azurite answered 10/9, 2015 at 1:53 Comment(0)
F
0

go to Gradle panel and run it by double click on it on message line it show you where your project are error for example maybe you have a sound or movie or a file or ... that it compact in your project on the google android i'm really sorry that my English is really very poor

Fenelia answered 5/10, 2015 at 6:4 Comment(0)
R
0

You get this error when you use Java keywords in your resources name.

Radiochemical answered 6/12, 2015 at 10:20 Comment(0)
O
0

Had the same problem. I changed the file build.gradle inside the app folder from this: compileSdkVersion 23 buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.vastsoftware.family.farmingarea"
    minSdkVersion 11
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

to this:

compileSdkVersion 23 buildToolsVersion "21.0.2"

defaultConfig {
    applicationId "com.vastsoftware.family.farmingarea"
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"

and worked perfectly! hope it works for you too!

O answered 22/3, 2016 at 22:24 Comment(0)
D
0

I had Same problem and soved by moved

ic_launcher.png files from drawable folder to mipmap folder.

Dermatome answered 25/3, 2016 at 11:23 Comment(0)
A
0

For me it was an error with my resources, Just changed the resources of my project in resources folder and res folder(i.e. for android) and it worked fine.

Build Successful

Total Time: 1 min 10.034 secs

Altman answered 9/6, 2016 at 15:36 Comment(0)
P
0

There may be some errors in your layouts like android:id="@id/ instead of android:id="@+id/.... At least that was the cause for my exception.

Passable answered 15/3, 2017 at 14:52 Comment(0)
M
0

Check if any SDK platform was partially installed. If it does, reinstall it.

Membrane answered 14/5, 2017 at 12:3 Comment(0)
M
0

I stumbled upon this error while updating my Android studio to 3.0.1 from 2.3. After trying all the solutions above, i found that the issue was with the Build tools version. I was using an unsupported version of build tools. I changed mine as below and it worked.

buildToolsVersion '26.0.2'

As a rule of thumb always try to use the latest version of Build tools supported by your Gradle version. From version 3.0.0 of Gradle, you don't need to specify the build tools version as this is picked up automatically.

3.0.0 (October 2017) : Android plugin for Gradle 3.0.0

With this update, you no longer need to specify a version for the build tools—the plugin uses the minimum required version by default. So, you can now remove the android.buildToolsVersion property.

https://developer.android.com/studio/releases/gradle-plugin.html#3-0-0

Mckeehan answered 16/2, 2018 at 10:29 Comment(0)
D
0

For me I had to run Android Studio in Admin mode.

Windows 10 x64

Davedaveda answered 20/2, 2018 at 16:2 Comment(0)
H
0

In my case several red lines appeared like:

AGPBI: {"kind":"error","text":"error: resource drawable/start_gray_border (aka com.example:drawable/start_gray_border) not found.","sources":[{"file":"C:\\Users\\User\\AndroidStudioProjects\\example\\app\\src\\main\\res\\layout\\activity_start.xml","position":{"startLine":37}}],"original":"","tool":"AAPT"}

I tried gradlew build --stacktrace, rebuild, clean build, checked file names, checked if resources contained invisible symbols, LF, CRLF, changed libraries versions and so on. A problem was in new XML files:

<?xml version="1.0" encoding="utf-8"?><?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
...

Removed a duplicate tag. I understood where a problem is when reverting to previous commit in GIT. After that added several new files and saw what file raises error.

Haematocryal answered 19/7, 2018 at 11:23 Comment(0)
S
0

In my case, I changed the android section in build.gradle and the problem faded away:

android {
compileSdkVersion 28

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "app.ozel"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

}

Selfreliance answered 12/8, 2020 at 10:5 Comment(0)
S
0

In my case, I needed to turn off Avast antivirus for a build time. Antivirus was blocking build when it tried to process this file:

platforms\android\app\build\intermediates\runtime_symbol_list\debug\R.txt
Selfexplanatory answered 7/12, 2020 at 16:24 Comment(0)
R
0

This error has a chance of triggering when the API version AVD which you selected is not the same as you specified in Project_folder>android>app>build.gradle as compileSdkVersion and targetSdkVersion.

Earlier my API version was 27 and now it is 30. I have changed the values of the above two parameters to 30 and my problem got solved.

Rabbinism answered 13/2, 2021 at 19:5 Comment(0)
I
0

The problem in my case was in my activity.xml . I had forgotten to add the reference in the beginning of the xml file. For example, I had this code

   <com.huawei.hms.ads.banner.BannerView
            android:id="@+id/hw_banner_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:visibility="visible"
            hwads:adId="testw6vs28auh3" ------------------> THIS NEEDED REFERENCE
            hwads:bannerSize="BANNER_SIZE_360_57"/>

I fixed by adding this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:hwads="http://schemas.android.com/apk/res-auto" --------> ADD THIS
Iowa answered 1/9, 2021 at 16:1 Comment(0)
H
0

for me it was a missing Manifest that was to blame. I created a new module and forgot to add Manifest

Heti answered 16/5, 2022 at 11:7 Comment(0)
A
0

Updated October 2022 (React Native 70)

buildToolsVersion = "30.0.3"
minSdkVersion = 24
compileSdkVersion = 31
targetSdkVersion = 31
kotlinVersion = '1.6.21'

Updated source: https://developer.android.com/studio/releases/gradle-plugin#7-3-0

If not work, please check your code.

Tips: You can run your app in android studio the check the build log.

Armillary answered 8/10, 2022 at 5:2 Comment(0)
E
-2

change the sdk version to 21 if its 20 and also make sure the build version as 21.0.1

Ephemeral answered 3/4, 2015 at 7:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.