java - 致命异常 : java. lang.NoSuchMethodError:没有虚拟方法 callEngineReleaseConnection(Lcom/squareup/okhttp/Call;)

标签 java android android-studio gradle okhttp

完整错误描述如下:

Fatal Exception: java.lang.NoSuchMethodError: No virtual method callEngineReleaseConnection(Lcom/squareup/okhttp/Call;)V in class Lcom/squareup/okhttp/internal/Internal; or its super classes (declaration of 'com.squareup.okhttp.internal.Internal' appears in /data/app/com.glossyglobe.client-1/base.apk:classes2.dex)
       at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:125)
       at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:42)
       at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:102)
       at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:177)
       at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
       at java.lang.Thread.run(Thread.java:818)

我不明白为什么会显示这个错误。库和依赖项可能会更新,但不会 请告诉我如何解决?

buildscript {

    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://www.jitpack.io" }
        maven { url "https://maven.google.com" }
        maven { url 'http://jcenter.bintray.com' }
        maven { url = 'https://oss.sonatype.org/content/repositories/snapshots'}
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        classpath 'com.github.triplet.gradle:play-publisher:1.2.2'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.github.triplet.play'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

def AAVersion = '4.3.1'
def AmplitudeVersion = '2.9.2'
def frescoVersion = '1.2.0'

android {
    compileSdkVersion = 29
    buildToolsVersion "29.0.3"

    aaptOptions
            {
                cruncherEnabled = false
            }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/*'
        exclude 'META-INF/LICENSE.txt'

        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "http://jzaccone.github.io/SlidingMenu-aar" }
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
    google()
    jcenter()
}

play {
    if (!project.hasProperty('track_value')) {
        logger.info("you need pass track (alpha, beta, production) -Ptrack_value=value")
        return
    }

    if (!project.hasProperty('service_account')) {
        logger.info('Please pass service_account')
    }

    if (!project.hasProperty('key_file')) {
        logger.info('Please pass key_file')
    }

    track = track_value
    serviceAccountEmail = service_account
    pk12File = file(key_file)
}

dependencies {

    implementation 'com.parse.bolts:bolts-android:1.+'

    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.daimajia.easing:library:1.0.0@aar'
    implementation 'com.daimajia.androidanimations:library:1.1.2@aar'

    implementation 'com.makeramen:roundedimageview:2.0.0'

    implementation 'com.sothree.slidinguppanel:library:3.1.0'
    implementation 'com.jeremyfeinstein.slidingmenu:library:1.3@aar'

    implementation 'com.asksira.android:loopingviewpager:1.1.2'
    implementation 'com.romandanylyk:pageindicatorview:1.0.1'

    implementation "com.amplitude:android-sdk:$AmplitudeVersion"

    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') { 
        transitive = true
    }

    implementation 'com.appsflyer:af-android-sdk:5.2.0@aar' //5.1.1
    implementation 'com.android.installreferrer:installreferrer:1.1.2'


    implementation "com.android.support:appcompat-v7:" + SUPPORT_LIBRARY_VERSION
    implementation "com.android.support:recyclerview-v7:" + SUPPORT_LIBRARY_VERSION
    implementation "com.android.support:cardview-v7:" + SUPPORT_LIBRARY_VERSION
    implementation "com.android.support:design:" + SUPPORT_LIBRARY_VERSION
    implementation 'android.arch.lifecycle:extensions:1.1.1'


    implementation "com.google.firebase:firebase-core:16.0.1" //16.0.1
    implementation "com.google.firebase:firebase-messaging:18.0.0" //18.0.0
    implementation 'com.google.firebase:firebase-database:17.0.0'
    implementation 'com.google.firebase:firebase-analytics:16.0.1'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:18.0.0'

    implementation 'com.google.maps.android:android-maps-utils:0.3.4'

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

    implementation 'org.greenrobot:eventbus:3.0.0'

    implementation 'com.squareup.retrofit2:retrofit:2.8.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.4.1'
    implementation 'com.google.code.gson:gson:2.8.5' 

    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
    implementation "org.androidannotations:androidannotations-api:$AAVersion"

    implementation 'com.squareup.picasso:picasso:2.5.2' 
    implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

    implementation 'pl.charmas.android:android-reactive-location:0.10@aar'

    implementation 'com.googlecode.libphonenumber:libphonenumber:8.3.2'

    implementation 'com.stripe:stripe-android:7.0.1'

    implementation 'com.braintreepayments.api:drop-in:3.+'

    implementation 'com.payfort:start:0.2'

    implementation 'ru.tinkoff.acquiring:ui:1.4.5' 
    implementation 'ru.tinkoff.acquiring:card-io:1.4.5'

    implementation 'com.facebook.android:facebook-android-sdk:4.42.0' 
    implementation 'com.facebook.android:facebook-login:4.42.0' 

    implementation 'com.timqi.sectorprogressview:library:2.0.1'

    implementation 'com.github.florent37:singledateandtimepicker:2.1.1'

    implementation 'com.github.stfalcon:frescoimageviewer:0.5.0'
    implementation "com.facebook.fresco:fresco:$frescoVersion"


    implementation 'com.cesards.android:cropimageview:1.0.2.1'


    implementation 'com.hbb20:ccp:2.2.0'

    implementation 'com.netflix.rxjava:rxjava-android:0.18.4'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':creditCardEntry')
    implementation project(':wheel')
    implementation project(':viewflow')
    implementation project(path: ':chat')

    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.android.gms:play-services-identity:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-gcm:16.0.0'
    implementation 'com.google.android.gms:play-services-base:16.0.0'

}

附注如果信息内容数据不够,我会补充

最佳答案

找了好久的解决方案,发现:原来是之间有冲突 'com.squareup.retrofit2:改造:2.8.1'“com.google.firebase:firebase-firestore:18.0.0”。 只需删除此内容:'com.google.firebase:firebase-firestore:18.0.0' 来源:https://en.programqa.com/question/58921485/

关于java - 致命异常 : java. lang.NoSuchMethodError:没有虚拟方法 callEngineReleaseConnection(Lcom/squareup/okhttp/Call;),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60975171/

相关文章:

android - 在 Android 上的 Eclipse 中调试有什么问题?

eclipse - 工作区 eclipse 中已存在具有该名称的项目

Android Studio Kotlin 正则表达式与预期不同

java - 获取背景按钮并将此颜色应用于另一种颜色

java - Rest url 中查询参数的日期时间格式

java - java的代数方程解析器

java - 计算文件中的字符、单词和行数

java - 将 X509 证书转换为 PEM 或 ASN.1/DER

php - 如何使用 Flutter 访问 Woocommerce API?

java - 在 viewpager fragment 中添加按钮并在另一个 Activity 中添加 Intent ?