1

So I'm getting the following error

Error:Execution failed for task ':app:transformClassesWithMultidexlistForHrmultipluscardPrerelease'.

java.io.IOException: Can't read [/Users/posao/Library/Android/sdk/build-tools/21.0.0/multidex/shrinkedAndroid.jar] (No such file or directory)

I've tried different devices, emulators, different versions of the SDK. I've also tried switching to the default gradle wrapper (It gives me the same error then)

Googling for shrinkedAndroid.jar doesn't give any benificial results

Mislav Javor
  • 1,429
  • 1
  • 15
  • 23
  • That means there is no any file exist. – Chirag Savsani Dec 14 '15 at 10:29
  • Check that this file exits on the given path. – Eric B. Dec 14 '15 at 10:41
  • post your `build.gradle` – IntelliJ Amiya Dec 14 '15 at 11:15
  • The file does not exist in the directory at all. So it can't be gradle – Mislav Javor Dec 14 '15 at 11:51
  • This is caused by having multiDexEnabled set to true. Removing it will stop the error, but it will not be solving the problem. My application needs MultiDex to work at this point, and I can't get past the error Mislav is facing. – Shadoninja Jan 10 '16 at 05:22
  • No it was my fault... One of my other project's exported jar file was compiled using Java 8 which was a big no from Android. Very cryptic error messages led me to hours down the wrong paths. Here is the link to my problem and the solution to what I did wrong. Thanks for replying. https://stackoverflow.com/questions/34703059/unable-to-fix-parseexception-bad-class-file-magic-cafebabe-or-version-0034?noredirect=1#comment57152088_34703059 – Shadoninja Jan 12 '16 at 21:46

4 Answers4

2

You have multiDexEnable:true, try removing that.

Chewpers
  • 2,430
  • 5
  • 23
  • 30
1

In your app/build.gradle

android {
    buildToolsVersion "23.0.3"
}

Or use a later build tool version.

Egemen Hamutçu
  • 1,602
  • 3
  • 22
  • 34
0

In the end, the problem was that the Android SDK was corrupted somehow. Deleting the entire SDK and re-downloading and re-installing solved the problem

Mislav Javor
  • 1,429
  • 1
  • 15
  • 23
0

I encounter the same problem as you,The reason maybe AndroidSDK corrupted somehow and delete the target file shrinkedAndroid.jar.

I just delete the target buildToolsVersion lib dir here: ~/Downloads/android-sdk/build-tools/23.0.2 Then the AndroidStudio prompt me to 'Install Build Tools 23.0.2' when I sync Gradle. Redownload it and I build the project success.

banking
  • 480
  • 2
  • 9