Reputation: 4074
All of a sudden I cannot get Gradle to build any projects under Android Studio.
Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '\Local\Android\sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1
My Gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.marathon.simplelist"
minSdkVersion 8
targetSdkVersion 22
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'
}
Even if I create a new Blank Activity project I still get this error.
I have Android Studio 1.3.1 installed with
SDK Platforms: 5.X, 5.1, 5.0, 4.4, 2.3.3 SDK Tools: SDK Build Tools, SDK Tools 24.4, Platform-Tools 23.0.1
Obviously something is reconfigured locally since even a new empty project will not build. Ideas on how I can resolve this?
Upvotes: 27
Views: 75217
Reputation: 719
In my case, i was wrongly mentioned dp as d in dimension file. That cause this issue, once i corrected that value everything working fine. So due to some new added wrong values or files may cause this issue.
Upvotes: 0
Reputation: 1439
I spent nearly 12 hour to find the resolution to this issue and finally I found the resolution.
This kind of supernatural issue, might happen in the below cases,
When your code has some problem, like sometimes IntelliJ/AndroidStudio does not report the compilation errors. Open each class and check for any compilation issues, these compilations issues will be because of not able to resolve few dependencies.
When you have a library that is latest, but you are referring to the oldest version.(Similar to point 1).
When you have a library that is dependent on some other library and that in turn referencing to old library, but your direct library is referring to newer version.
Importing from JFrog Artifactory, but your cache is not cleared, and you app is still holding to older version of .aar file
Your current gradle version of the app is latest, but you imported some other project as library and that version is older.
Your current gradle version of the app is latest, but you imported .aar file from jfrog artifactory and that is build from older gradle version.
when you are trying all the above cases, clean and build, or if this doesn't work, try "invalidate cache and Restart".
error like this will fall in some or the other above mentioned cases.
Happy Coding..!
Upvotes: 0
Reputation: 189
In my case, due to duplicated attributes in xml causes this issue. For example,
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello"
android:text="Hello" />
Upvotes: 0
Reputation: 18406
You may miss the some resources.
You can find the exact problem using following steps
Click -> gradle (right side)
Goto app-> Tasks -> build -> assembleDebug
Double click assembleDebug
You will get the exact error. you can fix your problem
Upvotes: 3
Reputation: 561
In my case, I backtracked everything that I implemented and found that the issue was in the xml layout file that I was using for my login screen.
The relation that I had defined among the child views within the RelativeLayout(parent layout), was causing the error.
So the way to avoid such errors in future is to keep running/checking the code as soon as you implement anything, to avoid long backtracking(which was in my case).
Hope this would be of some help!
Upvotes: 0
Reputation: 304
Goto gradle.properties
under Gradle Scripts
then set android.enableAapt2=true
clean and Rebuild the project
Upvotes: 5
Reputation: 176
In my case, I just used this 'android:drawableTop="2dp"'
with a TextView
. Obviously, it is an invalid reference.
It is a good way to revert to the last git version when met with this problem.
Upvotes: 0
Reputation: 180
I also have same error : "aapt-exe-finished-with-non-zero-exit-value-1"
In my code there was an mistake in layout xml file about drawable file name, after correct it. Its working for me.
Upvotes: 0
Reputation: 1395
Add Below Library in gradle file .
compile "com.android.support:appcompat-v7:26.0.2"
compile "com.android.support:support-v13:26.0.2"
Upvotes: 0
Reputation: 287
I also faced similar problem, got it fixed by disabling "Instant Run" option,
File>Settings>Build,Execution,Deployment>Instant Run
Under Instant Run tab, disable "Enable Instant Run to hot swap code.."
Upvotes: -1
Reputation: 31
I also faced the same issue and worked for hours on it and finally found out the solution. The drawable file that I referred in my xml was not existed. I removed the code and rebuild the project. It worked. My advice if anyone face such an issue, please look into your res folder.
Upvotes: 3
Reputation: 3184
Have got the same error in React Native.I upgraded the android sdk version and resulted into this.
Root cause : old version's packager collect resources.
Solution : delete directories like 'drawable-xxxx' (ATTN:no 'v?' postfix) under $(rn_project)\android\app\src\main\re.
Reference :https://github.com/facebook/react-native/issues/5787#issuecomment-236408669
Upvotes: 0
Reputation: 43
Upgrade your buildToolsVersion to latest and make sure your appcompactv7 import matches the sdk buildtoolversion. In my case it was buildToolsVersion '26.0.0'. Upgrading to it solved my issue.
Upvotes: 1
Reputation: 21
Always try to use the latest one for build tools. You have to change the line buildToolsVersion "XX.X.X" in build.gradle file (which generally resides under mobile directory in gradle 2.0) to the latest version : 23.0.2 or 24.0.2 or 25.0.2 (in my case). And then Rebuild Project. If you still have an issue, please try to update the corresponding build tool via Android SDK Manager.
Upvotes: 1
Reputation: 5367
If someones is using react-native
(and have updated it's version recently) and having this problem:
Quoting @chamchamgo:
I found the root cause is that old version's packager collect resources (image etc.) and put under $(rn_project)\android\app\src\main\res, while newer version put them under $(rn_project)\android\app\build\intermediates\res\merged\$(buildType). It brings duplication which leads to failure of task 'processReleaseResources'. And it also explains why new created project works well. When you have an old RN project upgrading to newer version, just delete directories like 'drawable-xxxx' (ATTN:no 'v?' postfix) under $(rn_project)\android\app\src\main\res and wolrd will be nice.
Check the whole thread at: https://github.com/facebook/react-native/issues/5787#issuecomment-236408669
Upvotes: 6
Reputation: 41
Android studio only accepts images within a certain file name frame
Invalid file name: must contain only [a-z0-9_.]
I had a file by Korean. so I delete then It's worked!!!
Upvotes: 1
Reputation: 794
Mostly, this problem cause by wrong resource in xml file, I suggest you return your code before everything is fine. then add your new code step by step and check xml file carefully.
Upvotes: 0
Reputation: 141
in my case: I create new cordova project, then this aapt close in android studio, then i just update SDK Build Tools to 23.0.3 latest version. make sure you have installed MinSdkVersion & targetSdkVersion in android default 'sdk/build-tools' folder
Upvotes: 1
Reputation: 1463
Change The buildToolsVersion To compileSdkVersion as Shown Below Code:...
Before: It Was Not Working....
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'com.kdmsl.kraapp'
minSdkVersion 14
versionCode 3
versionName "1.3"
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
After Changes:
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
applicationId 'com.kdmsl.kraapp'
minSdkVersion 14
versionCode 3
versionName "1.3"
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
Upvotes: 0
Reputation: 1419
If the error is occuring while Gradle Processes Resources, then it is most likely an issue with your resources. Check your gradle console to make sure.
Double check any recent changes that you may have made to the res
folder.
In my case, I simply renamed a resource (banner.png
to something_else_banner.png
since banner.png
must have been reserved), and it worked!
Other things I tried that failed:
:app:processDebugResources FAILED
.Upvotes: 1
Reputation: 11
It might be a bit too late to answer, but I didn't find a perfect answer, so here what worked for me:
I renamed couple of fields in attrs > declareStylable so they were pointing to non-existant enums and that's what caused a error for me.
Upvotes: 1
Reputation:
this error happened when you delete any resource as image which is used in any file the android studio rise this error
the solution
Build -> clean project Build -> rebuild project
good luck
Upvotes: 1
Reputation: 91
see gradle console output,
in my case - :app:processDemoReleaseResources FAILED
it was cyrillic file name in asset folder
Upvotes: 9
Reputation: 304
In my case I was using wrong string resource id in a layout file. After I fixed it and rebuilded the project the error was gone. Hope this helps!
Upvotes: 1
Reputation: 55
I've got the same problem. The solution was to move project folder into drive root folder. It looks like my project folder has huge path ("D:\DropBox\Dropbox\Video\Full Stack Web Development\Course 4 - Multiplatform Mobile App Development with Web Technologies\Week 3 - Deploying your App\Exercise 1\ionic\conFusion\"). After moving "Exercise 1" folder to the root of disk D, problem was gone.
Upvotes: 0
Reputation: 541
First try to clean and rebuild your project from Build menu.
Step 1: go to Build -> Clean Project
Step 2: go to Build -> Rebuild Project
This should solve your problem.
Otherwise try updating Android SDK build tool from SDK manager and modify your build.gradle to use latest buildToolsVersion i.e "23.0.2" as of now
Upvotes: 25