jainsahab / androidsnooper Goto Github PK
View Code? Open in Web Editor NEWAndroid library to record the network calls through the interceptor mechanism of the http clients.
License: Apache License 2.0
Android library to record the network calls through the interceptor mechanism of the http clients.
License: Apache License 2.0
Way to reproduce:
Client App with the following:
Snooper-Spring
or Snooper-OKHttp
, the dependency for Snooper
will get pulled in by which ever you use. In our case, we have both and Snooper-Spring
brought in Snooper
HttpCallListActivity
HttpCallActivity
You will get an exception similar to this:
06-03 12:39:40.824 6596-6596/com.vaa.runway.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my.package.dev, PID: 6596
java.lang.NoSuchMethodError: No virtual method addOnTabSelectedListener(Landroid/support/design/widget/TabLayout$OnTabSelectedListener;)V in class Landroid/support/design/widget/TabLayout; or its super classes (declaration of 'android.support.design.widget.TabLayout' appears in /data/app/com.my.package.dev-1/base.apk:classes10.dex)
at com.prateekj.snooper.networksnooper.activity.HttpCallActivity.setupUi(HttpCallActivity.java:82)
at com.prateekj.snooper.networksnooper.activity.HttpCallActivity.onCreate(HttpCallActivity.java:69)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
It does not matter if you exclude the support group or if the hosting application pulls in design via implementation or api, it will always crash here.
To get around this, I had to:
./gradlew publish
gradle/wrapper/gradle-wrapper.properties
(e.g., localSnooperLibaryRoot
)I also tested this out locally by changing implementation
to api
while keeping the support as 27, but that didn't work.
One path I did not check was reducing the target to 27 to keep it in line with guidelines to align target + support pre-AndroidX
i am using androidX.
java.lang.IncompatibleClassChangeError: Class 'com.prateekj.snooper.networksnooper.activity.HttpCallActivity$1' does not implement interface 'com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener' in call to 'void com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener.onTabUnselected(com.google.android.material.tabs.TabLayout$Tab)' (declaration of 'com.google.android.material.tabs.TabLayout$1' appears in base.apk)
at com.google.android.material.tabs.TabLayout$1.onTabUnselected(TabLayout.java:825)
at com.google.android.material.tabs.TabLayout.dispatchTabUnselected(TabLayout.java:1798)
at com.google.android.material.tabs.TabLayout.selectTab(TabLayout.java:1782)
at com.google.android.material.tabs.TabLayout.selectTab(TabLayout.java:1745)
at com.google.android.material.tabs.TabLayout$Tab.select(TabLayout.java:2136)
at com.google.android.material.tabs.TabLayout$TabView.performClick(TabLayout.java:2324)
at android.view.View.performClickInternal(View.java:6585)
at android.view.View.access$3100(View.java:785)
at android.view.View$PerformClick.run(View.java:25921)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Steps to replicate.
1.) Navigate to Header tab
2.) Change the orientation of device
Expected Behaviour
Orientation should change and header tab should be visible
Actual Behaviour
Orientation is getting changed but the loader is not going away off the screen leaving the screen non-interactive.
Hello,
I was using v1.5.5 with okhttp :
// Android Snooper library for Okhttp
implementation('com.github.jainsahab:Snooper-Okhttp:1.5.5@aar') {
transitive = true
}
When I upgrade to 1.5.6, I can not run my unit tests anymore, do you have an idea of what happened ? Maybe there is a conflict in dependencies ?
// Android Snooper library for Okhttp
implementation('com.github.jainsahab:Snooper-Okhttp:1.5.6@aar') {
transitive = true
}
The error appear when I run ./gradlew app:compilePrimaryDebugUnitTestKotlin
:
> Task :app:compilePrimaryDebugUnitTestKotlin FAILED
e: /Users/benj/Desktop/XXX/XXX-android-client/app/src/test/java/com/wayzup/object/ObjectTestHelper.kt: (3, 27): Unresolved reference: lang3
e: /Users/benj/Desktop/XXX/XXX-android-client/app/src/test/java/com/wayzup/object/ObjectTestHelper.kt: (18, 26): Unresolved reference: SerializationUtils
e: /Users/benj/Desktop/XXX/XXX-android-client/app/src/test/java/com/wayzup/object/ObjectTestHelper.kt: (19, 28): Unresolved reference: SerializationUtils
// val snooperRepo = SnooperRepo(context)
// snooperRepo.deleteAll()
error log:
because there is no current transaction.
When my using material version 1.1.0-alpha05, the snooper library crashes with the following exception:
Caused by: java.lang.ClassCastException: com.prateekj.snooper.networksnooper.activity.HttpCallActivity$setupUi$1 cannot be cast to com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener
09-24 11:41:47.662 11526 11526 E AndroidRuntime: at com.prateekj.snooper.networksnooper.activity.HttpCallActivity.setupUi(HttpCallActivity.kt:72)
09-24 11:41:47.662 11526 11526 E AndroidRuntime: at com.prateekj.snooper.networksnooper.activity.HttpCallActivity.onCreate(HttpCallActivity.kt:61)
Are there plans to update the library using material version 1.1.0 or later? Looks like it's using 1.0.0 which is quite old.
java.lang.RuntimeException:Unable to start activity ComponentInfo{com.nebula.chargemew/com.prateekj.snooper.networksnooper.activity.HttpCallListActivity}: android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=5, totalRows=6
When click on 2nd or 3rd tab, it's crashed.
**occurred on most of the android version
Solution:
have been solved by changing following:
replace following snippets-
In class HttpCallActivity:
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
....
by
tabLayout.addOnTabSelectedListener(new TabLayout.BaseOnTabSelectedListener() { ....
please update this library with resolving this issue
Thanks
@jainsahab It would be really helpful if you can add no-op dependencies for all the modules as it makes the life of consumer a whole lot easier while using this library.
I found out that SnooperInterceptor prevents Glide to download images and show them properly.
When I remove SnooperInterceptor from my OkHttpClient, Glide works fine.
You can try it via http://via.placeholder.com/300/09f/fff.png
SDK Version: 1.5.5@aar
Android OS Version: 11
Device: Xiaomi RedMi Note 9 Pro
Dear Author,
We are currently using your library to read the API requests and responses for the Android app. However, for one of the APIs, the data coming from the backend is a huge and lengthy JSON, and clicking to see the network request and response causes the app to crash.
Kindly take a look in fixing as early as possible.
The below is the error:-
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vaa.runway.dev/com.prateekj.snooper.networksnooper.activity.HttpCallListActivity}: android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=7
Thanks,
Sagar
Hello,
I would like to disable onShake Action for my app which is using AndroidSnooper. Let me know how it can be done.
when any client side error occurs, snooper isn't saving that exception. Hence, the user will never be notified about what caused the request to fail?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.