google / volley

https://google.github.io/volley
Apache License 2.0
3.37k stars 751 forks source link

Getting E/Volley: [19618] NetworkDispatcher.processRequest: Unhandled exception #448

Closed manumathew17 closed 1 year ago

manumathew17 commented 1 year ago

Getting error

E/Volley: [19618] NetworkDispatcher.processRequest: Unhandled exception com.android.tools.idea.kotlin.UninitializedPropertyAccessException: lateinit property interceptedResponse has not been initialized
    com.android.tools.idea.kotlin.UninitializedPropertyAccessException: lateinit property interceptedResponse has not been initialized
        at com.android.tools.appinspection.network.httpurl.TrackedHttpURLConnection.getHeaderFields(TrackedHttpURLConnection.kt:336)
        at com.android.tools.appinspection.network.httpurl.HttpsURLConnectionWrapper.getHeaderFields(HttpsURLConnectionWrapper.kt:189)
        at com.android.volley.toolbox.HurlStack.executeRequest(HurlStack.java:107)
        at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:104)
        at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)
        at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
        at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
E/ERROR: com.android.volley.VolleyError: com.android.tools.idea.kotlin.UninitializedPropertyAccessException: lateinit property interceptedResponse has not been initialized

The api is working fine in postman

jpd236 commented 1 year ago

This doesn't look to me like a Volley bug - at least not directly. It seems like you're using Android Studio's network inspector (https://developer.android.com/studio/debug/network-profiler), which is injecting some logic into the HttpURLConnection being used by Volley that appears to crash. Does the issue reproduce if you build a standalone APK and install that rather than using Android Studio?

Assuming so, I'd recommend filing a bug against Android Studio at https://developer.android.com/studio/report-bugs as I don't see any existing reports that look quite like this.

Closing this out under the assumption that the issue lies elsewhere; if you can reproduce an issue without the Android Studio network tracking (and presumably get a different stacktrace), or if you find that there is something Volley is doing wrong that is somehow interfering with the tracking that we could resolve, then feel free to reopen.

manumathew17 commented 1 year ago

Thanks, @jpd236 for the update Is it because of debug apk? because I tried in the real device also

jpd236 commented 1 year ago

I'm not familiar enough with how Android Studio injects this logic into the APK, but I assume that if you build a production APK, or a debug APK using Gradle directly rather than from within Android Studio, either should work. I don't know that it would have anything to do with whether it runs on a real device or emulator. But in any case, your best bet is to follow up in an Android Studio bug.

manumathew17 commented 1 year ago

Thanks, @jpd236 for the update