运行代码的时候,出现了这个问题,build报错
Program type already present: android.support.v4.app.BackStackRecord$Op
Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)}
虽然不知道具体意思,感觉就是v4包冲突,可是我不会找在哪冲突的
在网上疯狂搜解决办法,没有一个奏效
给各位大佬呈上我的build.gradle
apply plugin: 'com.android.application'android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.asus.bs_im"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        //use legacy for android 6.0
        useLibrary 'org.apache.http.legacy'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }
    }
}dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.google.code.gson:gson:2.8.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    api project(':easeui')
    configurations { all*.exclude group: 'com.android.support', module: 'support-v13' }}
整了两三个小时了,各种办法都试过了,希望有大佬来拯救一下我这个辣鸡

解决方案 »

  1.   

    其他地方是不是也添加了v4 比如lib下边。如果有的话删除试试
      

  2.   

    使用gradle dependencies查看还有哪个lib也依赖了v4,然后在它下面excludev4即可
      

  3.   

    我真的要崩溃了,gradle dependencies以后发现好像app里没有依赖v4包的,服了
      

  4.   

    楼主解决了吗,你需要把截图中  项目里easeui里面的那个v4的jar包删掉就可以了,项目gradle中虽然没有引用,但是好像还是加载进依赖项了。
      

  5.   

    如果有重复的jar在libraries里会看到的,然后使用二分法:注释一半导包然后sync一下看看是否重复