1

C:\Users\I\AndroidStudioProjects\Project\app\src\main\res\mipmap-hdpi\exchange.png Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\I\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 42 Error:Execution failed for task ':app:mergeDebugResources'.

C:\Users\I\AndroidStudioProjects\Project\app\src\main\res\mipmap-hdpi\exchange.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\I\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 42

This question isn't answered with an accepted answer on stackoverflow My R.java doesn't work to. Does anyone know how to solve these problems. build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildToolsVersion "22.0.0"
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
Anoniem
  • 75
  • 12

4 Answers4

1

Check if the PNG file where you get the error is really a PNG file. I had the same problem and I realized it was a JPG.

Fer
  • 1,956
  • 2
  • 28
  • 35
0

Check your xml code. Make sure you have no capitalized naming of ids. and also check your xml file names to ensure none of them have capitalized naming or invalid characters such as numbers.

  1. You can also try replacing your "exchange.png" file in main\res\mipmap-hdpi\exchange.png with another file to see if it works, since your logcat is pointing to that file.
  • If I replace/delete that file then there is a next error in one of the other png files. I have added some more info – Anoniem Mar 20 '15 at 15:00
0

Install a drawable plugin or check your images op good sizes! Make drawable maps because mipmap is only for icons.

Anoniem
  • 75
  • 12
0

You should try doing a ./gradlew clean build on the terminal. After that, type ./gradlew --refresh-dependencies and you should be good to go!

Dico
  • 320
  • 4
  • 7