1

Here is dependencies

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    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 group: 'io.nlopez.smartlocation', name: 'library', version: '3.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.google.android.gms:play-services-location:11.4.2'
    compile 'com.google.android.gms:play-services-base:11.4.2'
    compile 'com.google.android.gms:play-services-maps:11.4.2'
    compile 'com.github.arimorty:floatingsearchview:2.1.1'
    compile 'com.jota.autocompletelocation:autocomplete-location:0.9.0'
    testCompile 'junit:junit:4.12'
}

and when I run my app getting this error.

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

com.android.builder.dexing.DexArchiveMergerException: com.android.tools.r8.errors.CompilationError: Program type already present: com.google.android.gms.internal.zzbcg

how can I fix this ???

Hemant Parmar
  • 3,924
  • 7
  • 25
  • 49

2 Answers2

0

replace implementation 'com.android.support.constraint:constraint-layout:1.0.2'

with compile 'com.android.support.constraint:constraint-layout:1.0.2' like below code

    dependencies {

    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    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 group: 'io.nlopez.smartlocation', name: 'library', version: '3.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.google.android.gms:play-services-location:11.4.2'
    compile 'com.google.android.gms:play-services-base:11.4.2'
    compile 'com.google.android.gms:play-services-maps:11.4.2'
    compile 'com.github.arimorty:floatingsearchview:2.1.1'
    compile 'com.jota.autocompletelocation:autocomplete-location:0.9.0'
    testCompile 'junit:junit:4.12'
}
Omkar
  • 3,040
  • 1
  • 22
  • 42
0

If cleaning project did not help, I would suggest you delete these folders

  • \build
  • .idea
  • .gradle
  • app\build

then rebuild the project.

lakshman.pasala
  • 565
  • 6
  • 16