简体   繁体   English

java.lang.NoSuchMethodError: 没有静态方法 get(Ljava/lang/String;)Lokhttp3/HttpUrl; 在类 Lokhttp3/HttpUrl 中; 或者它的超类

[英]java.lang.NoSuchMethodError: No static method get(Ljava/lang/String;)Lokhttp3/HttpUrl; in class Lokhttp3/HttpUrl; or its super classes

My project was working fine before integrating Small case Library .在集成Small case Library之前,我的项目运行良好。 After integration I'm getting this error at the time of installing application.集成后,我在安装应用程序时收到此错误。

java.lang.NoSuchMethodError: No static method get(Ljava/lang/String;)Lokhttp3/HttpUrl; in class Lokhttp3/HttpUrl; or its super classes (declaration of 'okhttp3.HttpUrl' appears in /data/app/base.apk!classes3.dex)
        at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:506)

here I'm attaching App level gradle file.在这里,我附上了应用程序级别的 gradle 文件。

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


android {
    compileSdkVersion 29
    packagingOptions {
        exclude 'META-INF/*'
    }
    defaultConfig {
       
        minSdkVersion 23
        targetSdkVersion 29
       
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    configurations{
        all*.exclude module: 'okhttp'
        all*.exclude module: 'okio'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }




    buildToolsVersion '29.0.2'

}




dependencies {
    implementation project(path: ':library')
    implementation project(path: ':library')
    implementation project(path: ':library')
    testImplementation 'junit:junit:4.12'
 
    implementation 'com.smallcase.gateway:sdk:2.9.3'

    implementation ('com.squareup.retrofit2:retrofit:2.9.0') {
        exclude module: 'okhttp'
    }
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
    implementation 'com.squareup.okhttp3:okhttp:3.4.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
   

}

As mentioned in other answers I have already tried setting CompileOptions with Java 1.8.正如其他答案中提到的,我已经尝试使用 Java 1.8 设置 CompileOptions。 but no luck.但没有运气。 Any help would be appreciated.任何帮助,将不胜感激。

use both the newest version (Retrofit & OkHttp)使用最新版本 (Retrofit & OkHttp)

https://github.com/square/retrofit/issues/3058 https://github.com/square/retrofit/issues/3058

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.NoSuchMethodError: 没有虚拟方法 toString(Z)Ljava/lang/String; 在 class Lokhttp3/Cookie; 或其超类 - java.lang.NoSuchMethodError: No virtual method toString(Z)Ljava/lang/String; in class Lokhttp3/Cookie; or its super classe java.lang.NoClassDefFoundError:无法解决以下问题:Lokhttp3 / MediaType; - java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/MediaType; 没有 static 方法 delimiterOffset 在 class Lokhttp3/internal/Util - No static method delimiterOffset in class Lokhttp3/internal/Util java.lang.NoSuchMethodError:没有虚方法getMccString()Ljava / lang / String; - java.lang.NoSuchMethodError: No virtual method getMccString()Ljava/lang/String; NoClassDefFoundError:解析失败:Lokhttp3/logging/HttpLoggingInterceptor; - NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor; NoClassDefFoundError:解析失败:Lokhttp3/internal/Platform - NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform java.lang.NoSuchMethodError:类Lcom / google / firebase / FirebaseApp中没有虚拟方法zzbqo()Z; 或其超一流 - java.lang.NoSuchMethodError: No virtual method zzbqo()Z in class Lcom/google/firebase/FirebaseApp; or its super classes NoClassDefFoundError:解析失败:Lokhttp3/logging/HttpLoggingInterceptor - NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor Android studio java.lang.NoSuchMethodError: No static 方法 encodeBase64URLSafeString([B)Ljava/lang/String; - Android studio java.lang.NoSuchMethodError: No static method encodeBase64URLSafeString([B)Ljava/lang/String; 此处地图:产生者:java.lang.NoSuchMethodError:没有非静态方法“ Ljava / lang / AssertionError;。 <init> (Ljava / lang / String;)V” - HERE map:Caused by: java.lang.NoSuchMethodError: no non-static method “Ljava/lang/AssertionError;.<init>(Ljava/lang/String;)V”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM