当前位置: 首页 > 知识库问答 >
问题:

错误:程序类型已存在:OKHTTP3.Address

齐坚成
2023-03-14
apply plugin: 'com.android.application'


android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.bestdocapp.kiosk_opd"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    debug {
        debuggable true
        applicationIdSuffix '.debug'
        versionNameSuffix '-DEBUG'


    }

    staging {
        debuggable true
        applicationIdSuffix ".debugStaging"
        versionNameSuffix '-STAGING'
        resValue "string", "app_name", "Kiosk Live"
    }



    release {
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        resValue "string", "app_name", "Kiosk"
        debuggable true
    }
}
dataBinding {
    enabled = true
}

compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}

}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
implementation 'com.brandongogetap:stickyheaders:0.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation (project(':library_name'))

共有1个答案

金子平
2023-03-14

我也有类似的问题。当我构建时,在德兴过程中,它会抛出这个构建错误:

Program type already present: okhttp3.Address

在出现错误的Android Studio中,它建议我通过转到谷歌文档中的这个页面来解决这个问题:https://developer.Android.com/Studio/build/dependencies#duplicate_classes

我刚刚更新了谷歌服务

classpath 'com.google.gms:google-services:4.2.0'
 类似资料: