2

Here is my build.gradle

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.example.demo"
        minSdkVersion 16
        targetSdkVersion 21
        multiDexEnabled true
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    aaptOptions
            {
                cruncherEnabled = false
            }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    repositories {
        maven { url "https://jitpack.io" }
    }
}

dependencies {
    compile project(':draggerLibrary')
    compile project(':staggeredGridViewmaster')



    compile files('libs/httpclientandroidlib-1.2.1.jar')
    compile files('libs/httpcore-4.4-beta1.jar')
    compile files('libs/httpmime-4.3.jar')
    compile project(':viewPagerLibrary')
    compile project(path: ':ViewPagerLibrary')

    compile 'com.android.support:multidex:1.0.1'
    compile 'joda-time:joda-time:2.4'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.google.android.gms:play-services:11.0.2'

    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'com.google.guava:guava:20.0'
    compile "com.daimajia.swipelayout:library:1.2.0@aar"
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
    compile 'org.apache.commons:commons-collections4:4.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
}

Error:Execution failed for task ':DemoProject:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/provider/DocumentsContractApi19.class

ashish
  • 848
  • 6
  • 16
  • Check this : https://stackoverflow.com/questions/37497882/errorexecution-failed-for-task-apptransformclasseswithdexfordebug-in-androi/37498040#37498040 – Dipali Shah Jul 06 '17 at 11:39
  • 1
    use `compile 'com.google.android.gms:play-services:11.0.2'` and `compile 'com.android.support:appcompat-v7:25.0.0'` – IntelliJ Amiya Jul 06 '17 at 11:41
  • @IntelliJAmiya : Thnks for answer . if i going to use 11.0.2 than i got error like Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'. Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'. – ashish Jul 06 '17 at 11:43
  • @ashish `compileSdkVersion 25 buildToolsVersion "25.0.2"` – IntelliJ Amiya Jul 06 '17 at 11:45
  • @ashish use `compile 'com.android.support:appcompat-v7:25.3.1'` .After that clean-Rebuild and RUN – IntelliJ Amiya Jul 06 '17 at 11:49
  • @IntelliJAmiya : i resolved that error but i can not get object like googleMap = ((MapFragment) getFragmentManager().findFragmentById( R.id.map)).getMap(); – ashish Jul 06 '17 at 11:49
  • @Dipalishah : I have already configure my build that you mentioned in answer. Thnks for answer – ashish Jul 06 '17 at 11:51
  • @ashish kindly check my answer .Hope it will works – IntelliJ Amiya Jul 06 '17 at 11:58

1 Answers1

3

Configure your build.gradle .

Use

compileSdkVersion 25 
buildToolsVersion "25.0.2"

Then

compile 'com.google.android.gms:play-services:11.0.2' 
compile 'com.android.support:appcompat-v7:25.3.1'

For your MAP problem use getMapAsync()

 SupportMapFragment mapOBJ = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map));
  mapOBJ.getMapAsync(this);

Read Replace getMap with getMapAsync

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198