Shopify / mobile-buy-sdk-android

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using their credit card.
MIT License
214 stars 136 forks source link

Failed to parse GraphQL http response #598

Closed khalilcodecorner closed 5 years ago

khalilcodecorner commented 5 years ago

com.shopify.buy3.GraphParseError: Failed to parse GraphQL http response at com.shopify.buy3.HttpResponseParser.parseTopLevelResponse(HttpResponseParser.java:76) at com.shopify.buy3.HttpResponseParser.parse(HttpResponseParser.java:48) at com.shopify.buy3.HttpCallbackWithRetry.onResponse(HttpCallbackWithRetry.java:71) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.ClassCastException: com.google.gson.JsonNull cannot be cast to com.google.gson.JsonObject at com.shopify.buy3.HttpResponseParser.parseTopLevelResponse(HttpResponseParser.java:72) at com.shopify.buy3.HttpResponseParser.parse(HttpResponseParser.java:48)  at com.shopify.buy3.HttpCallbackWithRetry.onResponse(HttpCallbackWithRetry.java:71)  at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)  at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)  at java.lang.Thread.run(Thread.java:764) 

khalilcodecorner commented 5 years ago

i found out that cache is creating problem in this when i comment out the cache and set cache policy to HttpCachePolicy.NETWORK_FIRST then it start working but when i include cache in it is cause problem again and show cache Key miss