Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':app:shrinkReleaseMultiDexComponents'

I am getting following error when generating signed apk in Android Studio.

:app:shrinkReleaseMultiDexComponents FAILED
Error:Execution failed for task ':app:shrinkReleaseMultiDexComponents'.
> java.io.IOException: The output jar [E:\SVN_studio\100's\trunk\app\build\intermediates\multi-dex\release\componentClasses.jar] must be specified after an input jar, or it will be empty.
Information:BUILD FAILED
Information:1 error
Information:Total time: 35.975 secs
Information:159 warnings

here is my build.gradle file

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 21
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "<packageName>"
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true


    }
}
packagingOptions {
    exclude 'META-INF/LICENSE.txt'
}
lintOptions {
    abortOnError true;
}

}

repositories {
   mavenCentral()
}
repositories {
   flatDir {
     dirs 'libs'
   }
}

dependencies {
 compile fileTree(include: ['*.jar'], dir: 'libs')
 compile 'com.nineoldandroids:library:2.4.0'
 compile 'com.android.support:design:22.2.1'
 compile 'com.google.android.gms:play-services-gcm:7.5.0'
 compile 'com.android.support:cardview-v7:21.0.+'
 compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
 compile 'com.android.support:support-v13:22.2.1'
 compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
 compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
 compile 'com.android.support:recyclerview-v7:22.2.1'
 compile 'com.mikhaellopez:circularimageview:2.0.1'
 compile(name: 'app-debug', ext: 'aar')
 compile 'com.facebook.android:facebook-android-sdk:4.1.0'
 compile files('libs/YouTubeAndroidPlayerApi.jar')
}

Dont know why i am getting those error? can anyone help me?

like image 205
Ravi Avatar asked Dec 04 '15 10:12

Ravi


3 Answers

Try to false on minifyEnable and sync project

 buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    } }
like image 178
Mohit Suthar Avatar answered Oct 12 '22 21:10

Mohit Suthar


Set minifyEnabled to false and Sync gradle and project.

like image 2
Piyush Avatar answered Oct 12 '22 23:10

Piyush


Try removing...

compile files('libs/YouTubeAndroidPlayerApi.jar')

because

compile fileTree(include: ['*.jar'], dir: 'libs')

will compile all jar files.

like image 2
Arth Tilva Avatar answered Oct 12 '22 21:10

Arth Tilva