[英]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.