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

OkHttp 4.9.0 causes java.lang.LinkageError when NewRelic SDK is used. #6277

Closed
alapshin opened this issue Sep 21, 2020 · 3 comments
Closed
Labels
bug Bug in existing code

Comments

@alapshin
Copy link

After upgrading to OkHttp 4.9.0 New Relic instrumentation agent fails with

java.lang.LinkageError: Method okhttp3.Request$Builder com.newrelic.agent.android.instrumentation.okhttp3.RequestBuilderExtension.delete() overrides final method in class Lokhttp3/Request$Builder;
    at com.newrelic.agent.android.instrumentation.okhttp3.OkHttp3Instrumentation.build(OkHttp3Instrumentation.java:34)
    at retrofit2.RequestFactory.create(RequestFactory.java:132)
    at retrofit2.OkHttpCall.createRawCall(OkHttpCall.java:208)
    at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:130)
    at retrofit2.adapter.rxjava3.CallEnqueueObservable.subscribeActual(CallEnqueueObservable.java:42)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
    at retrofit2.adapter.rxjava3.BodyObservable.subscribeActual(BodyObservable.java:35)
    at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13099)
    at io.reactivex.rxjava3.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:36)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
    at io.reactivex.rxjava3.internal.operators.single.SingleOnErrorReturn.subscribeActual(SingleOnErrorReturn.java:38)
    at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
    at io.reactivex.rxjava3.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
    at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
    at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:764)

Downgrading OkHttp back to 4.8.1 solves this problem.
Version of NewRelic android agent doesn't seem to affect outcome. I tried both 5.26.0 and most recent 5.27.1 and result was the same.

@alapshin alapshin added the bug Bug in existing code label Sep 21, 2020
@swankjesse
Copy link
Collaborator

Please report this to NewRelic. OkHttp model classes are not designed to be subtyped. If they're doing it anyway, they are playing with fire!

@alapshin
Copy link
Author

Ok, thanks for response.
Created matching discussion in relevant forum https://discuss.newrelic.com/t/newrelic-doesnt-work-with-okhttp-4-9-0/115403
If you think that there is nothing to do from OkHttp side feel free to close this issue.

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

No branches or pull requests

2 participants