Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FATAL EXCEPTION: OkHttp Dispatcher #220

Closed
matamicen opened this issue Oct 6, 2020 · 4 comments
Closed

FATAL EXCEPTION: OkHttp Dispatcher #220

matamicen opened this issue Oct 6, 2020 · 4 comments

Comments

@matamicen
Copy link

Hi guys,
First of all thanks for this library :)

As soon we installed the latest version of this library (6.2.0) the app crashes and the log throws:

 E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: com.mqreobxc, PID: 902
    java.lang.NoSuchMethodError: No static method delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I in class Lokhttp3/internal/Util; or its super classes (declaration of 'okhttp3.internal.Util' appears in /data/app/com.mqreobxc-pjTGFWZTq6IKd0DOql_nDw==/base.apk!classes3.dex)

We are using RN 063.2 and the only library that use okhttp seems to be Flipper, which is installed by default in this RN version but we are not using it, and here is the only code that we found okhttp is in build.gradle:

dependencies {
        implementation fileTree(dir: "libs", include: ["*.jar"])
        //noinspection GradleDynamicVersion
        implementation "com.facebook.react:react-native:+"  // From node_modules

        implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
        debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
            exclude group:'com.facebook.fbjni'
        }
        debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
            exclude group:'com.facebook.flipper'
            exclude group:'com.squareup.okhttp3', module:'okhttp'
        }
        debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
            exclude group:'com.facebook.flipper'
        }

Any help will be appreciated.

Thanks @StevePotter

@reime005
Copy link
Contributor

reime005 commented Oct 7, 2020

@matamicen can you try with these two additions?
implementation 'com.squareup.okhttp3:okhttp:3.2.1'
and
implementation 'com.squareup.okhttp3:okhttp:4.4.1'

@matamicen
Copy link
Author

@reime005 Thanks for your soon answer :)

Where exactly do I have to add implementation 'com.squareup.okhttp3:okhttp:3.2.1' and implementation 'com.squareup.okhttp3:okhttp:4.4.1' ?

Thanks.

@reime005
Copy link
Contributor

reime005 commented Oct 7, 2020

@matamicen to your app's android/app/build.gradle dependencies

@matamicen
Copy link
Author

@reime005 good news!

it was a RN thing so nothing wrong with this library, the app was crashing when I call a simple FETCH, so we had to add this to the dependencies and everything is working now, it seems that happens with okhttp above version 4 which is the version that use this library on version above 6.0.0 thru android-upload-service :)

    implementation "com.squareup.okhttp3:okhttp:4.4.1"
    implementation "com.squareup.okhttp3:logging-interceptor:4.4.1"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:4.4.1"

here is the link, may be it helps someone.

I have another question with this library that may be you can help me again :) but I am going to open a new issue, so I will close this one.

Thanks again!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants