Skip to content

Commit afdf31a

Browse files
runningcodeclaude
andcommitted
test(instrumentation): Stub removed sentry-android-okhttp event listener
VisitorTest verifies instrumented bytecode against the real classes on the test classpath. After bumping sentry to 8.43.0, the test classpath provides sentry-okhttp instead of sentry-android-okhttp, so io.sentry.android.okhttp.SentryOkHttpEventListener no longer resolves. The classloader then generated an empty stub extending Object, which is not an okhttp3.EventListener subtype, so the eventListener() call in the legacy useSentryAndroidOkHttp path failed bytecode verification. Generate a stub for it that extends io.sentry.okhttp.SentryOkHttpEventListener, mirroring the real inheritance so the verifier accepts the call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b901140 commit afdf31a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • plugin-build/src/test/kotlin/io/sentry/android/gradle/instrumentation/classloader/mapping

plugin-build/src/test/kotlin/io/sentry/android/gradle/instrumentation/classloader/mapping/OkHttpMapping.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ val okHttpMissingClasses =
1212
{ name ->
1313
standardClassSource(name, superclass = "okhttp3.internal.Internal")
1414
},
15+
// Removed from the Sentry SDK in 8.0.0; generate a stub so the verifier can still
16+
// resolve it for the legacy useSentryAndroidOkHttp instrumentation path.
17+
"io.sentry.android.okhttp.SentryOkHttpEventListener" to
18+
{ name ->
19+
standardClassSource(name, superclass = "io.sentry.okhttp.SentryOkHttpEventListener")
20+
},
1521
)

0 commit comments

Comments
 (0)