程序类型已经存在:org.hamcrest.CoreMatchers-Android build error

时间:2018-07-19 08:27:39

标签: android android-studio react-native gradle build

我无法弄清楚这里是什么错误以及导致该错误的原因。我无法建立这个专案。

我在构建时遇到的错误是:

Program type already present: org.hamcrest.CoreMatchers

这是我的摇篮:

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    defaultConfig {
        applicationId "in.greylabs.beacon"
        minSdkVersion 26
        targetSdkVersion 27
        versionCode 11
        versionName "3.0.0"
        multiDexEnabled true
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    /* dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }*/
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86"
        }
    }

    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    implementation project(path: ':react-native-image-picker')
    implementation project(path: ':react-native-image-resizer')
    implementation project(path: ':react-native-fs')
    implementation project(':react-native-maps')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    implementation ("com.google.firebase:firebase-messaging:17.1.0")
    implementation 'com.google.android.gms:play-services-analytics:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-gcm:15.0.1'
    implementation project(path: ':react-native-fabric')

    implementation 'com.android.support:multidex:1.0.3'
}

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

0 个答案:

没有答案