Error:Execution failed for task ':app:transformClassesWithDexForRelease' - Android studio -


i have created android application using android studio, , works fine when run android emulator or device connected development machine, when try install apk build/outputs/apk application crashes on opening.also tried generate signed apk android studio build -> generate signed apk (both release , debug) fails generate apk following error:

error:execution failed task ':app:transformclasseswithdexforrelease'. > com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.dex.dexexception: multiple dex files define lorg/intellij/lang/annotations/identifier; 

my build.gradle file:

apply plugin: 'com.android.application'  android {     compilesdkversion 25     buildtoolsversion "25.0.0"     defaultconfig {         applicationid "com.aitrich.android.modern.photo"         minsdkversion 14         targetsdkversion 25         multidexenabled true         versioncode 1         versionname "1.0"         testinstrumentationrunner "android.support.test.runner.androidjunitrunner"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     } }   apply plugin: 'com.neenbedankt.android-apt' apply plugin: 'org.greenrobot.greendao'  ext {     supportlibraryversion = '25.0.1'     playservicesversion = '9.0.2'     retrofitversion = '2.1.0' }  greendao {     schemaversion 1 }  apt {     arguments {         staggeneratedpackagename "com.aitrich.android.modern.stag.generated"         stagdebug true     } }   dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     androidtestcompile('com.android.support.test.espresso:espresso-core:2.2.2', {         exclude group: 'com.android.support', module: 'support-annotations'     })     testcompile 'junit:junit:4.12'      compile "com.android.support:design:$supportlibraryversion"     compile "com.android.support:support-v13:$supportlibraryversion"     compile "com.android.support:cardview-v7:$supportlibraryversion"     compile 'org.greenrobot:eventbus:3.0.0'     compile 'org.greenrobot:greendao:3.2.0'     compile 'com.jakewharton:butterknife:8.4.0'     compile 'com.intuit.sdp:sdp-android:1.0.3'     compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'     compile 'com.mobsandgeeks:android-saripaar:2.0.3'     compile "com.squareup.retrofit2:retrofit:$retrofitversion"     compile "com.squareup.retrofit2:converter-gson:$retrofitversion"     compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'     compile 'com.squareup.picasso:picasso:2.5.2'     compile 'com.vimeo.stag:stag-library:2.0.2'     compile 'com.github.hotchemi:permissionsdispatcher:2.2.0'     compile 'com.tapadoo.android:alerter:1.0.6'     compile 'ch.halcyon:squareprogressbar:1.6.0'     compile 'com.yalantis:ucrop:2.2.0'     compile 'com.yalantis:ucrop:2.2.0-native'     compile 'com.evernote:android-job:1.1.8'     compile('com.github.silvestrpredko:dot-progress-bar:1.1') {         exclude group: 'com.android.support', module: 'appcompat-v7'     }     compile('com.github.stevendxc:dxloadingbutton:1.5') {         exclude group: 'com.android.support', module: 'appcompat-v7'     }     compile('com.redmadrobot:chronos:1.0.7') {         exclude module: 'eventbus:2.4.0'     }     compile ('co.infinum:materialdatetimepicker-support:3.1.3') {         exclude group: 'com.android.support', module: 'design'         exclude group: 'com.android.support', module: 'support-v4'         exclude group: 'com.android.support', module: 'support-v13'     }     compile 'com.android.support:multidex:1.0.1'       apt 'com.jakewharton:butterknife-compiler:8.4.0'     apt 'com.vimeo.stag:stag-library-compiler:2.0.2'     apt 'com.github.hotchemi:permissionsdispatcher-processor:2.2.0' } 

edit:

please check having 2 libraries common :

 compile 'com.yalantis:ucrop:2.2.0'  compile 'com.yalantis:ucrop:2.2.0-native' 

remove 1 of them , check 1 needed you.

check this answer multidex issue.that 1 helped me fix issue.

it seems logcat shows annotations identifier dexexception: multiple dex files define lorg/intellij/lang/annotations/identifier. should remove line support -annotations:

 androidtestcompile('com.android.support.test.espresso:espresso-core:2.2.2', {         exclude group: 'com.android.support', module: 'support-annotations'     }) 

moreover, if using google play services bundle : compile 'com.google.android.gms:play-services:8.1.0

change below gms separately libraries

compile 'com.google.android.gms:play-services-location:8.1.0'  compile 'com.google.android.gms:play-services-base:8.1.0'  compile 'com.google.android.gms:play-services-analytics:8.1.0'  compile 'com.google.android.gms:play-services-maps:8.1.0'   compile "com.google.android.gms:play-services-gcm:8.1.0'    // 

for gcm push notification


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -