Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs

后端 未结 22 2363
Happy的楠姐
Happy的楠姐 2020-11-29 07:49

I have this error when trying to make a module of a project

apply plugin: \'com.android.library\'

android {
    compileSdkVersion 17
    buildToolsVersion \         


        
相关标签:
22条回答
  • 2020-11-29 08:34

    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.

    0 讨论(0)
  • 2020-11-29 08:35

    Sometimes, it can be caused by wrong naming for xml or resource file.

    At least, for me, that problem was solved by changing name .

    0 讨论(0)
  • 2020-11-29 08:37

    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.

    0 讨论(0)
  • 2020-11-29 08:38

    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:

    1. Open your Android Studio (AS) program.
    2. Go to your build.gradle file in your project.
    3. Change:

      dependencies {
          classpath 'com.android.tools.build:gradle:1.1.0'
      

      to:

      dependencies {
          classpath 'com.android.tools.build:gradle:1.1.3'
      
    4. Sync your Android project with Gradle:

    5. Clean your project.

    6. Rebuild your project.
    7. Done!

    If its still not working:

    1. Close your Android Studio program and open it again.
    2. Try compiling the code.
    3. Done!

    If you need more help, read the issue on Google Code!

    0 讨论(0)
  • 2020-11-29 08:39

    I faced the same error but i solved this by selecting invalidate caches/restart option.

    Click

    1. file >> invalidate caches/restart
    0 讨论(0)
  • 2020-11-29 08:39

    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'
            }
        }
    
    0 讨论(0)
提交回复
热议问题