com.android.build,com.android.build.api.transform.TransformException: java.lang.IllegalStateExceptio...

I'm facing the following error:

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

> com.android.build.api.transform.TransformException: java.lang.IllegalStateException

My App build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'com.google.firebase.firebase-perf'

android {

compileSdkVersion 26

buildToolsVersion '26.0.2'

defaultConfig {

applicationId "ahija.com"

minSdkVersion 19

targetSdkVersion 26

versionCode 24

versionName "2.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

vectorDrawables.useSupportLibrary = true

multiDexEnabled true

}

configurations.all {

// resolutionStrategy.eachDependency { DependencyResolveDetails details ->

// def requested = details.requested

// if (requested.group == 'com.android.support') {

// if (!requested.name.startsWith("multidex")) {

// details.useVersion '26.1.0'

// }

// }

// }

}

dexOptions {

javaMaxHeapSize "4g"

}

compileOptions {

sourceCompatibility JavaVersion.VERSION_1_8

targetCompatibility JavaVersion.VERSION_1_8

}

buildTypes {

release {

minifyEnabled true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

packagingOptions {

exclude 'META-INF/DEPENDENCIES.txt'

exclude 'META-INF/LICENSE.txt'

exclude 'META-INF/NOTICE.txt'

exclude 'META-INF/NOTICE'

exclude 'META-INF/LICENSE'

exclude 'META-INF/DEPENDENCIES'

exclude 'META-INF/notice.txt'

exclude 'META-INF/license.txt'

exclude 'META-INF/dependencies.txt'

exclude 'META-INF/LGPL2.1'

}

}

dependencies {

implementation 'com.android.support:support-v4:26.1.0'

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

// androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

// exclude group: 'com.android.support', module: 'support-annotations'

// })

// GOOGLE

compile 'com.android.support.constraint:constraint-layout:1.0.2'

compile 'com.android.support:appcompat-v7:26.1.0'

compile 'com.android.support:recyclerview-v7:26.1.0'

compile 'com.android.support:design:26.1.0'

compile 'com.android.support:support-vector-drawable:26.1.0'

compile 'com.android.support:cardview-v7:26.1.0'

compile 'com.android.support:support-v13:26.1.0'

compile 'com.android.support:customtabs:26.1.0'

compile 'com.android.support:multidex:1.0.2'

compile 'com.google.code.gson:gson:2.8.1'

// PLAY SERVICES

compile 'com.google.android.gms:play-services-auth:11.4.2'

compile 'com.google.android.gms:play-services-maps:11.4.2'

compile 'com.google.android.gms:play-services-location:11.4.2'

// FIREBASE

compile 'com.google.firebase:firebase-messaging:11.4.2'

compile 'com.google.firebase:firebase-core:11.4.2'

compile 'com.google.firebase:firebase-auth:11.4.2'

compile 'com.google.firebase:firebase-database:11.4.2'

compile 'com.google.firebase:firebase-crash:11.4.2'

compile 'com.google.firebase:firebase-perf:11.4.2'

compile 'com.firebaseui:firebase-ui-database:3.0.0'

// FACEBOOK

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

// OTHERS

compile 'de.hdodenhof:circleimageview:2.1.0'

compile 'com.squareup:android-times-square:1.6.5@aar'

compile 'com.daimajia.easing:library:2.0@aar'

compile 'com.daimajia.androidanimations:library:2.3@aar'

compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1'

compile 'com.github.zurche:open-weather-map-android-wrapper:v0.1'

compile 'com.github.varunest:sparkbutton:1.0.5'

compile 'com.nineoldandroids:library:2.4.0'

compile 'com.daimajia.slider:library:1.1.5@aar'

compile 'de.cketti.mailto:email-intent-builder:1.0.0'

compile 'id.zelory:compressor:2.1.0'

compile 'com.github.jrvansuita:PickImage:2.1.4'

compile 'com.github.DamanSingh4321:ProProgressViews:v1.1'

compile group: 'com.cloudinary', name: 'cloudinary-android', version: '1.20.0'

// INTEGRATIONS

compile 'com.github.freshdesk:hotline-android:1.2.5'

// NEW AND COOL

compile 'com.jakewharton.timber:timber:4.5.1'

compile 'com.jakewharton:butterknife:8.8.1'

compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.squareup.okhttp3:okhttp:3.9.0'

// compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

// compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'

// ANNOTATION PROCESSORS

annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

// annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'

// TEST

// testCompile 'junit:junit:4.12'

}

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

If I try to build the app, it builds just fine and I get the APKs but if I try to run from Android Studio directly on my device, I get the above error.

How to fix it?

I am facing this error since a long time. I am currently testing by debug versions by manually building the apk and then transferring it to the phone.

The "run" button directly gives me the above error.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值