0

I am using android studio 3.0,no matter what i do i can't generate or build APK astonishingly it runs on emulator but build fails on real android device.

enter image description here

This is how the error appears when i try to build APK.

It actually works on other computers only on this system there is this issue.

Amal p
  • 2,882
  • 4
  • 29
  • 49

2 Answers2

1

Try this:

configurations {
    all*.exclude  module: 'gson'
}
jeprubio
  • 17,312
  • 5
  • 45
  • 56
  • Because i cant exclude it of i need it in other areas of my project. – Amal p Nov 13 '17 at 12:20
  • Maybe there is the gson and the jackson libraries in your project or different gson versions. You can execute _./gradlew app:dependencies_ in the Terminal tab and check the possible cause of this duplicity. – jeprubio Nov 13 '17 at 14:09
0

You must not have repeated library in your app or your dependence program try this

android {
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
        all*.exclude group: 'com.android.support', module: 'support-annotations'
    } 
}
Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50
  • Not working....Update: it actually works on other computers only on this system there is this issue. – Amal p Nov 13 '17 at 11:03