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

Android regression in okhttp instrumentation in 1.7.0 #4452

Closed
jkwatson opened this issue Oct 20, 2021 · 3 comments · Fixed by #4466
Closed

Android regression in okhttp instrumentation in 1.7.0 #4452

jkwatson opened this issue Oct 20, 2021 · 3 comments · Fixed by #4466
Labels
bug Something isn't working regression repro provided

Comments

@jkwatson
Copy link
Contributor

jkwatson commented Oct 20, 2021

Describe the bug
It appears that the okhttp3 instrumentation released in v1.7.0 contains a usage of java's MethodHandle which is not supported on Android before API level 'O' (API level 26).

Steps to reproduce
Do an android app build using the v1.7.0-alpha version of the okhttp3 instrumentation. Example build failure is here: signalfx/splunk-otel-android#176

What did you expect to see?
The build to succeed, and the Android gradle plugin is able to generate Android bytecode.

What did you see instead?

ERROR:/Users/jwatson/.gradle/caches/modules-2/files-2.1/io.opentelemetry.instrumentation/opentelemetry-instrumentation-api/1.7.0-alpha/d5e265ff68ba58266a61ef62730e142e32635a3f/opentelemetry-instrumentation-api-1.7.0-alpha.jar: D8: com.android.tools.r8.internal.n1: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)

What version are you using?
v1.7.0-alpha

Environment
Android Gradle Plugin version 7.0.3, targetting Android API level 21.

Additional context
N/A

@jkwatson
Copy link
Contributor Author

Unfortunately, this didn't fix the issue completely. Re-opening to track the continuing work.

@jkwatson jkwatson reopened this Oct 28, 2021
@jkwatson
Copy link
Contributor Author

New runtime issue (build works fine now):

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.splunk.android.sample, PID: 16867
    java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/ClassValue;
        at io.opentelemetry.instrumentation.api.internal.RuntimeVirtualFieldSupplier.get(RuntimeVirtualFieldSupplier.java:39)
        at io.opentelemetry.instrumentation.api.field.VirtualField.find(VirtualField.java:40)
        at io.opentelemetry.instrumentation.okhttp.v3_0.TracingCallFactory.<clinit>(TracingCallFactory.java:25)
        at io.opentelemetry.instrumentation.okhttp.v3_0.OkHttpTracing.newCallFactory(OkHttpTracing.java:68)

@laurit
Copy link
Contributor

laurit commented Dec 20, 2021

Fixed in 1.9.0

@laurit laurit closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression repro provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants