简体   繁体   English

没有 static 方法 delimiterOffset 在 class Lokhttp3/internal/Util

[英]No static method delimiterOffset in class Lokhttp3/internal/Util

I am using jitsi library for video connection.我正在使用 jitsi 库进行视频连接。 It works fine when installed for the first time but it crashes if a user already has application and updates it from play store.第一次安装时它工作正常,但如果用户已经拥有应用程序并从 Play 商店更新它,它会崩溃。 Logs from crash says:崩溃日志说:

No static method delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I in class Lokhttp3/internal/Util;没有 static 方法 delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I 在 class Lokhttp3/internal/Util; or its super classes (declaration of 'okhttp3.internal.Util' appears in base.apk.classes3.dex)或其超类('okhttp3.internal.Util' 的声明出现在 base.apk.classes3.dex 中)

There are 2 auto generated files: 1) okhttp3.JavaNetCookieJar 2) okhttp3.internal.Util.有 2 个自动生成的文件:1) okhttp3.JavaNetCookieJar 2) okhttp3.internal.Util。

From class JavaNetCookieJar , this delimiterOffset(header, pos, limit, ";,") method is called in Util class.从 class JavaNetCookieJar ,此delimiterOffset(header, pos, limit, ";,")方法在Util class 中调用。

Util class has delimiterOffset() method not compatible with the one which is called: Util的 delimiterOffset() 方法与调用的方法不兼容:

delimiterOffset(delimiters: String, startIndex: Int = 0, endIndex: Int = length)

delimiterOffset(delimiter: Char, startIndex: Int = 0, endIndex: Int = length)

Above methods are called there in Util class.上述方法在Util class 中被调用。

When I hover over JavaNetCookieJar class, it says that it comes from okhttp3-urlconnection-3.12.1 package and when I hover over Util package it says that it's from okhttp-4.8.0 . When I hover over JavaNetCookieJar class, it says that it comes from okhttp3-urlconnection-3.12.1 package and when I hover over Util package it says that it's from okhttp-4.8.0 . I am using我在用

implementation 'com.squareup.okhttp3:logging-interceptor:4.8.0'

Fun fact is even when I am deleting okhttp3 implementation in gradle, these 2 files are unaffected.有趣的事实是,即使我在 gradle 中删除 okhttp3 实现,这两个文件也不受影响。

You must use the exact same version of all OkHttp dependencies.您必须使用所有 OkHttp 依赖项的完全相同版本。 You can configure this manually or use the BOM to do it automatically.您可以手动配置或使用 BOM 自动配置。

dependencies {
   api(platform("com.squareup.okhttp3:okhttp-bom:4.8.0"))
   api("com.squareup.okhttp3:okhttp")              // No version!
   api("com.squareup.okhttp3:logging-interceptor") // No version!
}

Check if your gradle has this line:检查您的 gradle 是否有此行:

configurations {
    all*.exclude group: 'com.squareup.okio'
    all*.exclude group: 'com.squareup.okhttp3'
}

If so, just remove it or comment it如果是这样,只需删除它或评论它

configurations {
    //all*.exclude group: 'com.squareup.okio'
    //all*.exclude group: 'com.squareup.okhttp3'
}

Now clean and rebuild the project.现在清理并重建项目。

With an exception like this: Stack trace of error除了这样的例外:错误堆栈跟踪

I was able to solve it by commenting out the line in /android/app/build.gradle :我能够通过注释掉/android/app/build.gradle中的行来解决它:

    public void apply(OkHttpClient.Builder builder) {
      // builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
    }

暂无
暂无

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

相关问题 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 NoClassDefFoundError:解析失败:Lokhttp3/internal/Platform - NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform 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 NoClassDefFoundError:解析失败:Lokhttp3/logging/HttpLoggingInterceptor - NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor NoClassDefFoundError:解析失败:Lokhttp3/logging/HttpLoggingInterceptor; - NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor; 错误:将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Lokhttp3/internal/http/RealResponseBody; - Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/http/RealResponseBody; java.lang.NoClassDefFoundError:无法解决以下问题:Lokhttp3 / MediaType; - java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/MediaType; Android:具有后台线程的Util类静态方法(异步任务) - Android: Util class static method with background thread (async task) NoSuchMethodError: 没有 static 方法 getLogger(Ljava/lang/String;)Lsun/util/logging/PlatformLogger; 在 class Lsun/util/logging/PlatformLogger - NoSuchMethodError: No static method getLogger(Ljava/lang/String;)Lsun/util/logging/PlatformLogger; in class Lsun/util/logging/PlatformLogger java.lang.NoSuchMethodError:类Lcom / google / android / gms / common / util / zzu中没有静态方法; - java.lang.NoSuchMethodError: No static method in class Lcom/google/android/gms/common/util/zzu;
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM