Необработанная ошибка перевода: java.lang.IllegalArgumentException: уже добавлено: Lokhttp3 / internal / ws / RealWebSocket; - PullRequest
0 голосов
/ 30 октября 2019

У меня есть проект Android Studio, и я пытаюсь его запустить. Однако по некоторым причинам я не могу.

Я знаком с разработкой XCode и iOS, но я никогда раньше не работал с Android Studio, и это все для меня очень ново. Насколько я узнал, gradle - это то, что связывает и строит все это.

До сих пор я строил проект, скачивал эмуляторы и у меня было много ошибок, я исправил некоторые из них, но новыепоявляются. Это ошибка, которую я имею сейчас

Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/internal/ws/RealWebSocket;

Проекту 3-4 года, и некоторые пакеты устарели

Вот мой файл build.gradle, я слышал, что он может быть полезен. Буду признателен за любую помощь

apply plugin: 'com.android.application'

android {

    dexOptions {
        preDexLibraries = false
    }

    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "app.android.myApp.appdocoments"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 'io.appflate.restmock.android.RESTMockTestRunner'
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    androidTestCompile('com.github.andrzejchm.RESTMock:android:0.2.1', {
        exclude group: 'com.squareup.okio'
        exclude group: 'com.squareup.okhttp3'
        exclude module: 'okhttp-ws'
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2') {
        // Necessary if your app targets Marshmallow (since Espresso
        // hasn't moved to Marshmallow yet)
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestCompile('com.android.support.test:runner:0.3') {
        // Necessary if your app targets Marshmallow (since the test runner
        // hasn't moved to Marshmallow yet)
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:support-vector-drawable:25.4.0'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
//    compile 'com.squareup.retrofit2:converter-jackson:2.1.0'
    compile 'com.google.code.gson:gson:2.8.5'
    compile 'com.github.mancj:MaterialSearchBar:0.6'
    compile 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.1.3'
    compile 'com.github.andrzejchm.RESTMock:core:0.2.1'
    testCompile 'junit:junit:4.12'
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    compile 'com.kingfisherphuoc:easy-file-folder-picker-dialog:1.3'

}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...