I have this error when trying to make a module of a project
apply plugin: \'com.android.library\'
android {
compileSdkVersion 17
buildToolsVersion \
The problem might probably be due to the mismatch of the extension types given by the programmer and the actual extensions of the images present in the drawable folder of your app. or fixing this follow the steps given below:-
Step 1- Double click on each of the image resources and and check the extension i.e whether the image is png or jpeg or any other format.
Step 2- Now check if the same extension is given by you in the drawable folder dropdown in package explorer(a.k.a Android in Android Studio).
Step 3 - If the extensions are not matching then delete that image and paste another image of the same name in its place making sure the extension is matching with the actual extension of the image (for example, if the image is "a.png" then make sure the extension of the image given by you is also of .png type) .
Step 4 - Sync your gradle file and run the project. This time there should be no errors.
Sometimes, it can be caused by wrong naming for xml or resource file.
At least, for me, that problem was solved by changing name .
I have had this problem before with adding png files. I have discovered the problem with some of them since cleaning your project and closing AS does not solve every problem.
I did an experiment with GIMP when exporting images. Apparently, converting them to RGB fixes it. Some photos will be set to Indexed mode. Simply select Image>Mode>RGB. Then, export it and copy it into AS.
I was getting the same error and it worked for me. Hope it helps.
As Niklas said, you have to update to the latest Gradle version.
My way to solve the error:
build.gradle
file in your project.Change:
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
to:
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
Sync your Android project with Gradle:
Clean your project.
If its still not working:
If you need more help, read the issue on Google Code!
I faced the same error but i solved this by selecting invalidate caches/restart option.
Click
Even i had same problem,this solution helped me so it might help you
check build version is matching with compile sdk version and add below code inside android block of build.gradle
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}