Every thing was perfectly fine until I made some changes to my code and try to regenerate the signed APK. Now when I try to generate the code in android studio I get the following exception:
Error:Execution failed for 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 Lcom/commonsware/cwac/provider/StreamStrategy;
This exception is something new to me. Here is my gradle file and dependencies
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
aaptOptions {
noCompress 'pdf'
}
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.user.plansmart"
minSdkVersion 15
targetSdkVersion 25
versionCode 23
versionName "1.2.6"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
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'
})
compile files('D:/AndroidStudioProjects/PlanSmart/libs/itextpdf-5.4.0.jar')
compile files('D:/AndroidStudioProjects/PlanSmart/libs/cwac-provider-
0.5.2.jar')
compile files('D:/AndroidStudioProjects/PlanSmart/libs/volley.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-ads:11.2.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.commonsware.cwac:provider:0.5.2'
compile 'com.mcxiaoke.volley:library:1.0.1'
testCompile 'junit:junit:4.12'
}
What could be the reason for error. Am not able to figure it out. Can anyone help me out.