chucker
chucker copied to clipboard
Cannot resolve symbol ChuckerInterceptor
:writing_hand: Describe the bug
I have followed the steps provided in the overview screen https://github.com/ChuckerTeam/chucker. Even after adding the dependency unable to resolve ChuckerInterceptor
:bomb: Steps to reproduce
Step1 : dependencies { debugImplementation "com.github.chuckerteam.chucker:library:3.5.2" releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.5.2" } Added above dependency in my app build.gradle file Step 2: Trying to add ChuckerInterceptor in my okHttpInterceptor then unable to resolve the ChuckerInterceptor
:wrench: Expected behavior
I should be able to add ChuckerInterceptor without any issue
- Chucker version: 3.5.2 using latest version
:page_facing_up: Additional context
I have added jitpack library in my maven repository. Adding chucker into application is very straight forward with very minimal steps, not sure why i am facing this issue. Please let me know if i need to add any more dependency to solve my issue
I can't help you further without a reproducer. However:
Trying to add ChuckerInterceptor in my okHttpInterceptor then unable to resolve the ChuckerInterceptor
- Have you done a Gradle Sync just after adding the dependency?
- Have you tried to build from terminal? Is it working correctly?
- Could you provide a Gradle Scan: https://scans.gradle.com/
@Nesh-Brindha Were you able to resolve the issue?
Waiting for an answer as well. I can build my app in debug build fine but when I switch to release build the chucker classes cannot be resolved.
Waiting for an answer as well. I can build my app in debug build fine but when I switch to release build the chucker classes cannot be resolved.
Can you provide a reproducer? As long there is no reproducer for this, I'm leaning towards considering this a problem with your specific buidl configuration
@cortinico I didn't know what was going on. I actually fixed the problem on my own. I used to have these in my app.gradle:
debugImplementation "com.github.chuckerteam.chucker:library:3.5.2" releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.5.2"
That didn't work because all the chucker classes are not resolved when I switched to the release build variant.
To fix the issue, I had to use:
implementation "com.github.chuckerteam.chucker:library:3.5.2"
And use this block of code below to only use the ChuckerInterceptor in debug build variant.
if (BuildConfig.DEBUG) { okHttpClientBuilder.addInterceptor(chuckerInterceptor) }
I actually fixed the problem on my own.
I can't call it a fix, since you don't need Chucker classes in your release builds. Could you provide some sample project where the problem can be reproduced?
I can't call it a fix, since you don't need Chucker classes in your release builds.
Agree. You might be good if you're using ProGuard as ChuckerInterceptor
gets stripped away given that it's inside a if (BuildConfig.DEBUG)
block. Still worth to investigate what's the underlying issue.
https://scans.gradle.com/s/d3rn3sd44pl2m -- had the same kind of failure, but this was due to my own office VPN.