Getting following error while generatin APK in android studio
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/commons/collections/ArrayStack.class
Here is my gradle.build file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 24
buildToolsVersion "24"
// useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.gogetapps.uternity"
minSdkVersion 18
targetSdkVersion 24
versionCode 5
versionName "0.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
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'
}
configurations {
all*.exclude group: 'org.apache.httpcomponents'
all*.exclude group: 'org.apache.commons'
all*.exclude group: 'org.apache.commons'
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile('com.google.android.gms:play-services:9.0.2') {
exclude group: 'com.google.guava'
}
compile 'dev.dworks.libs:volleyplus:+'
compile project(':cmediaplayer')
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.android.support:percent:24.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile ('com.android.support:support-v4:24.0.0') {
force = true
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.jkwiecien:EasyImage:1.2.3'
compile 'com.mukesh:countrypicker:1.1.3'
compile 'com.sa90.materialarcmenu:library:1.4.1'
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile('commons-validator:commons-validator:1.4.1') {
exclude group: 'commons-logging'
}
compile('commons-io:commons-io:2.5') {
exclude group: 'commons-logging'
}
compile('commons-lang:commons-lang:2.2') {
exclude group: 'commons-logging'
}
compile 'com.timehop.stickyheadersrecyclerview:library:0.4.3'
compile 'com.github.curioustechizen.android-ago:library:1.3.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'net.alhazmy13.MediaPicker:libary:2.1.4'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.nononsenseapps:filepicker:2.5.3'
compile 'com.writingminds:FFmpegAndroid:0.3.2'
compile 'com.kbeanie:image-chooser-library:1.5.8#aar'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.7'
compile 'com.github.deano2390:MaterialShowcaseView:1.1.0'
compile 'com.github.barteksc:android-pdf-viewer:1.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
compile('com.crashlytics.sdk.android:crashlytics:2.6.1#aar') {
transitive = true;
}
}
This is the link to dependency map.
Dependency Map
Related
In my CI pipeline until June 6 it worked. Today it failed. The following build error occurred.
WARNING: Module 'com.android.support:support-vector-drawable:26.0.2' depends on one or more Android Libraries but is a jar
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not find support-vector-drawable.jar (com.android.support:support-
vector-drawable:26.0.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-vector-
drawable/26.0.2/support-vector-drawable-26.0.2.jar
Build.Gradle file
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "io.realm:realm-gradle-plugin:3.1.4"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.newrelic.agent.android:agent-gradle-plugin:5.+'
classpath 'com.google.gms:google-services:3.1.0'
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://mobile-sdk.jumio.com' }
maven {
url "https://maven.google.com/" // Google's Maven repository
}
maven {
url "http://kochava.bintray.com/maven"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App level
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'newrelic'
apply plugin: "io.spring.dependency-management"
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
defaultConfig {
applicationId "com.seven.eleven.phoenix"
minSdkVersion 19
targetSdkVersion 26
versionCode 16
versionName "1.1.1_1_QA"
multiDexEnabled true
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
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'
}
sourceSets { main { assets.srcDirs = ['src/main/assets',
'src/main/assets/fonts'] } }
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
buildTypes.each {
it.buildConfigField 'String', 'STRIPE_APIKEY',
keystoreProperties['StripeKey']
it.buildConfigField 'String', 'PHOENIX_API_KEY',
keystoreProperties['PhoenixAPIKey']
it.buildConfigField 'String', 'NEW_RELIC_KEY',
keystoreProperties['NewRelicKey']
it.buildConfigField 'String', 'OPEN_WEATHER_API_KEY',
keystoreProperties['OpenWeatherAPIKey']
it.buildConfigField 'int', 'WORKING_BRANCH', getCurrentGitBranch()
}
}
def getCurrentGitBranch() {
def gitBranch = "Unknown branch"
try {
def workingDir = new File("${project.projectDir}")
def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir)
result.waitFor()
if (result.exitValue() == 0) {
gitBranch = result.text.trim()
}
} catch (e) {
}
if(gitBranch.contains('master')||gitBranch.contains('PROD') ||
gitBranch.contains('7XXX_Master')){
return "1";
} else {
return "0";
}
}
ext {
SDK_VERSION = "2.10.0"
ANDROID_VERSION = "26.0.2"
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.squareup.retrofit2:retrofit:2.3.0')
{
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
compile('com.squareup.retrofit2:converter-gson:2.3.0')
{
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
compile group: 'de.mindpipe.android', name: 'android-logging-log4j',
version: '1.0.3'
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile "com.android.support:cardview-v7:${ANDROID_VERSION}#aar"
compile "com.android.support:mediarouter-v7:${ANDROID_VERSION}#aar"
compile "com.android.support:palette-v7:${ANDROID_VERSION}#aar"
compile "com.android.support:design:${ANDROID_VERSION}#aar"
compile "com.android.support:appcompat-v7:${ANDROID_VERSION}#aar"
compile "com.jumio.android:core:${SDK_VERSION}#aar"
compile "com.jumio.android:bam:${SDK_VERSION}#aar"
compile "com.jumio.android:nv:${SDK_VERSION}#aar"
compile "com.jumio.android:nv-mrz:${SDK_VERSION}#aar"
compile "com.jumio.android:nv-barcode:${SDK_VERSION}#aar"
compile "com.jumio.android:nv-barcode-vision:${SDK_VERSION}#aar"
compile "com.jumio.android:nv-liveness:${SDK_VERSION}#aar"
compile "com.jumio.android:dv:${SDK_VERSION}#aar"
compile group: 'log4j', name: 'log4j', version: '1.2.17'
compile group: 'com.googlecode.libphonenumber', name: 'libphonenumber',
version: '7.0'
compile('com.squareup.retrofit2:converter-simplexml:2.3.0') {
exclude module: 'stax'
exclude module: 'stax-api'
exclude module: 'xpp3'
}
compile('org.simpleframework:simple-xml:2.7.1') {
exclude group: 'stax', module: 'stax-api'
compile('org.simpleframework:simple-xml:2.7.1') {
exclude group: 'stax', module: 'stax-api'
exclude group: 'xpp3', module: 'xpp3'
}
compile files('libs/simple-xml-2.7.1.jar')
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.kochava.base:tracker:3.2.0'
compile 'com.newrelic.agent.android:android-agent:5.+'
compile 'com.stripe:stripe-android:6.0.0'
testCompile 'junit:junit:4.12'
compile 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
provided 'javax.annotation:jsr250-api:1.0'
//for pay with google using google wallet service
compile 'com.google.android.gms:play-services-wallet:11.6.0'
compile 'com.google.android.gms:play-services:11.6.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'org.jsoup:jsoup:1.11.2'
compile
compile('com.amazonaws:aws-android-sdk-kms:2.6+') { transitive = true; }
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile "org.robolectric:robolectric:3.6.1"
}
dependencyManagement {
imports {
mavenBom 'com.amazonaws:aws-java-sdk-bom:1.11.257'
}
}
apply plugin: 'com.google.gms.google-services'
I have included the build gradle file as well as app level project configuration It was unable to download that dependency.Any help would be greatly appreciated.we are using an gradle 4.1 and a docker container to make the build. I used command ./gradle clean initially.
When i generate release build then i got this error
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/arch/core/internal/SafeIterableMap$ListIterator.class
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.23.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.hatchapps.multimedia"
minSdkVersion 16
targetSdkVersion 26
versionCode 17
multiDexEnabled = true
versionName "1.0"
// aaptOptions.cruncherEnabled = false
// aaptOptions.useNewCruncher = false
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// minifyEnabled false
multiDexEnabled = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
packagingOptions {
exclude '.readme'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'AndroidManifest.xml'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'eu.inloop:localmessagemanager:0.1.5'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.koushikdutta.ion:ion:2.2.1'
compile 'it.sephiroth.android.library.targettooltip:target-tooltip-library:1.3.15'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.cocosw:bottomsheet:1.3.0#aar'
compile 'com.zhy:flowlayout-lib:1.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
compile 'com.andkulikov:transitionseverywhere:1.7.4'
compile 'com.master.android:permissionhelper:1.1'
compile 'net.alhazmy13.MediaPicker:libary:2.3.2'
compile 'com.github.jaychang0917:SimpleText:1.2.1'
compile 'com.github.tabassumLatif:ShimmerRecyclerView:0.1.2'
compile 'com.tomergoldst.android:tooltips:1.0.6'
compile 'com.github.Pixplicity:sharp:03c1568d26'
compile 'id.zelory:compressor:2.0.0'
compile 'com.github.danikula:AndroidVideoCache:v2.7.0'
compile ('com.google.firebase:firebase-messaging:11.0.2'){
force = true
}
compile 'com.fenchtose:tooltip:0.1.5'
compile 'com.jsibbold:zoomage:1.1.0'
compile 'at.blogc:expandabletextview:1.0.3'
compile 'com.github.douglasjunior:android-simple-tooltip:0.2.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
compile 'com.oginotihiro:cropview:1.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.wonderkiln:camerakit:0.11.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile('com.android.support:support-v4:26.1.0'){
force = true
}
}
apply plugin: 'com.google.gms.google-services'
and
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
// classpath 'com.google.firebase:firebase-plugins:1.0.5'
classpath 'com.google.gms:google-services:3.0.0'
// classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://plugins.gradle.org/m2/" }
/*maven {
url "https://maven.google.com"
}*/
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Reading the comments, and having this problem myself, the problem seems to stem from a bad thirdparty lib. Perhaps using incompatible gradle or buildtool library.
Problem libs:
com.wonderkiln:camerakit:0.11.0
android.arch.persistence.room
com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer
Others have similar problems with bad libs in their /libs folder.
when I want to release my project this error happened:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/fasterxml/jackson/databind/AbstractTypeResolver.class
It's my Module Gradle:
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.vesal.servertest"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
multiDexEnabled true
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id : "3d64bedd-f82d-
4ffd-a968-a2f1caac0fc2",
onesignal_google_project_number: "577414806614"]
}
buildTypes {
release {
minifyEnabled false
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'
exclude 'META-INF/ASL2.0'
}
}
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'
})
compile('com.mikepenz:materialdrawer:5.9.5#aar') {
transitive = true
}
compile('com.github.orangegangsters:lollipin:2.0.0#aar') {
transitive = true
}
compile 'com.baoyz.pullrefreshlayout:library:1.2.0'
compile 'com.romainpiel.shimmer:library:1.4.0#aar'
compile 'com.wrapp.floatlabelededittext:library:0.0.6'
compile 'com.github.tibolte:elasticdownload:1.0.+'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.0'
compile 'com.airbnb.android:lottie:2.2.5'
compile 'devlight.io:navigationtabbar:1.2.5'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.vstechlab.easyfonts:easyfonts:1.0.0'
compile 'com.aurelhubert:ahbottomnavigation:2.0.4'
compile 'com.roughike:bottom-bar:2.3.1'
compile 'com.mikepenz:iconics-core:2.9.3#aar'
compile 'com.mikepenz:google-material-typeface:3.0.1.1.original#aar'
compile 'com.mikepenz:material-design-iconic-typeface:2.2.0.3#aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.1#aar'
compile 'com.mikepenz:octicons-typeface:3.2.0.3#aar'
compile 'com.mikepenz:meteocons-typeface:1.1.0.3#aar'
compile 'com.mikepenz:community-material-typeface:1.9.32.2#aar'
compile 'com.mikepenz:weather-icons-typeface:2.0.10.3#aar'
compile 'com.mikepenz:typeicons-typeface:2.0.7.3#aar'
compile 'com.mikepenz:entypo-typeface:1.0.0.3#aar'
compile 'com.mikepenz:devicon-typeface:2.0.0.3#aar'
compile 'com.mikepenz:foundation-icons-typeface:3.0.0.3#aar'
compile 'com.mikepenz:ionicons-typeface:2.0.1.3#aar'
compile 'com.mikepenz:pixeden-7-stroke-typeface:1.2.0.1#aar'
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
compile 'com.pegah.backtory:backtory-android-sdk:0.5.3'
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
compile 'com.android.support:design:26.1.0'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
}
and it's my Project Gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
url "https://www.jitpack.io"
url 'https://dl.bintray.com/pegah-backtory/maven/'
}
}
maven { url 'https://maven.google.com' }
maven { url "https://github.com/omadahealth/omada-
nexus/raw/master/release" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
help me Please!!
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class`
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.22.2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'android-apt'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.critinno.herenowfor"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles
getDefaultProguardFile('proguard-android.txt'),
'proguard- rules.pro'
}
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
res.srcDirs = ['src/main/res', 'src/main/res/drawable']
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'lib/armeabi-v7a/libblasV8.so'
exclude 'com/google/android/gms/ads/AdActivity.class'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.nex3z:flow-layout:0.1.3'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.firebase:firebase-storage:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.lorentzos.swipecards:library:1.0.9'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile("com.google.apis:google-api-services-language:
v1beta1-rev5-1.22.0") {
exclude module: 'httpclient'
exclude module: 'jsr305'
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile (group: 'com.google.cloud',
name: 'google-cloud-bigquery', version: '0.17.2-beta'){
exclude group: 'org.json'
exclude group: 'org.apache.httpcomponents'
}
}
apply plugin: 'com.google.gms.google-services'`
i getting this exception whenever i tried to run the project as method count overflow but when i build signed apk it runs fine ..furthermore i enabled proguard for realse so it is proguard which prevents multidex.. i get confused about multidex whether it is good or bad & why it is not showing any error while genrating signed apk .. any help is appriciated..below is my build.gradle file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
repositories {
maven { url "https://jitpack.io" }
}
android {
signingConfigs {
}
compileSdkVersion 23
useLibrary 'org.apache.http.legacy'
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxx.xxxx"
minSdkVersion 15
targetSdkVersion 22
//multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
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'
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile(project(':facebook')) {
exclude group: 'com.android.support', module: 'multidex'
}
compile project(':Volley')
compile project(':squarecamera')
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
//compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.2'
compile 'info.hoang8f:android-segmented:1.0.6'
compile 'com.shamanland:xdroid-toaster:0.0.10'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.android.support:design:23.1.1'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile 'com.malinskiy:superrecyclerview:1.1.2'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.2'
compile 'com.github.lecho:hellocharts-library:1.5.5#aar'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compil'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:1.0.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.klinkerapps:android-chips:1.0.1#aar'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
}