Duplicate entry: com / google / android / gms / internal / zzaj.class

I am running this application on Mac.

I am trying to run on a simulator and this is the error message I am getting from terminal

: application: transformClassesWithJarMergingForDebug FAILED

FAILURE: Build failed with exception.

  • What went wrong: Execution completed for task ': app: transformClassesWithJarMergingForDebug'.

    com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: COM / Google / Android / GMS / internal / zzaj.class

  • Try it: run with the -stacktrace option to get a stack trace. Run with the -info or --debug option to get more log output.

This is my build.gradle

def enableProguardInReleaseBuilds = false

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.qluster"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 3
        versionName '1.0'
        multiDexEnabled true
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a": 1, "x86": 2]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
    productFlavors {
    }
}

dependencies {
    compile project(':react-native-snackbar')
    compile project(':react-native-maps')
    compile project(':react-native-google-signin')
    compile project(':react-native-geocoder')
    compile project(':react-native-google-places')
    compile project(':react-native-camera')
    compile project(':react-native-fcm')
    compile project(':react-native-fbsdk')
    compile project(':react-native-android-location-services-dialog-box')
    compile fileTree(include: ['*.jar'], dir: 'libs')
    // From node_modules
    compile project(':react-native-vector-icons')
    compile project(':react-native-image-picker')
    compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms'
    }
    compile 'com.android.support:appcompat-v7:25.0.2'
    compile 'com.facebook.react:react-native:+'
    compile('com.google.android.gms:play-services-base:10.2.0') {
        force = true;
    }
    compile('com.google.android.gms:play-services-maps:10.2.0') {
        force = true;
    }
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile project(':react-native-get-real-path')
    compile(project(':react-native-google-signin')) {
        exclude group: 'com.google.android.gms'
    }
    compile('com.google.android.gms:play-services-auth:10.2.0') {
        force = true
    }
    compile ('com.google.android.gms:play-services:10.2.0')

    compile 'com.facebook.android:facebook-android-sdk:4.+'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile ('com.google.firebase:firebase-messaging:9.2.1') {
    exclude group: 'com.google.android.gms'
}
    compile project(':react-native-geocoder')
}

apply plugin: 'com.google.gms.google-services'

      

package.json

{
  "name": "qluster",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@mapbox/polyline": "^0.2.0",
    "axios": "^0.16.1",
    "crypto-js": "^3.1.9-1",
    "fbjs": "^0.8.12",
    "minutes-seconds-milliseconds": "^1.0.3",
    "react": "16.0.0-alpha.6",
    "react-native": "0.43.3",
    "react-native-android-location-services-dialog-box": "^1.2.1",
    "react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
    "react-native-camera-roll-picker": "^1.1.9",
    "react-native-fbsdk": "https://github.com/kidnapkin/react-native-fbsdk.git",
    "react-native-fcm": "^6.2.3",
    "react-native-geocoder": "^0.4.8",
    "react-native-get-real-path": "git+https://github.com/Wraptime/react-native-get-real-path.git",
    "react-native-google-places": "^2.1.0",
    "react-native-google-places-autocomplete": "^1.2.12",
    "react-native-google-signin": "^0.10.0",
    "react-native-image-picker": "^0.26.3",
    "react-native-keyboard-aware-scroll-view": "^0.2.8",
    "react-native-maps": "^0.13.1",
    "react-native-masked-text": "^1.3.3",
    "react-native-photo-browser": "^0.2.2",
    "react-native-router-flux": "3.38.0",
    "react-native-scrollable-tab-view": "^0.7.4",
    "react-native-simple-radio-button": "^2.5.0-alpha.1",
    "react-native-snackbar": "^0.3.6",
    "react-native-snackbar-dialog": "^1.3.0",
    "react-native-star-rating": "^1.0.7",
    "react-native-swiper": "^1.5.4",
    "react-native-vector-icons": "^4.0.1",
    "react-redux": "^5.0.4",
    "redux": "^3.6.0",
    "redux-saga": "^0.15.0"
  },
  "devDependencies": {
    "babel-jest": "19.0.0",
    "babel-preset-react-native": "1.9.1",
    "eslint-config-rallycoding": "^3.2.0",
    "jest": "19.0.2",
    "react-test-renderer": "16.0.0-alpha.6"
  },
  "jest": {
    "preset": "react-native"
  }
}

      

Screenshot from faliure

+3


source to share





All Articles