Application crash when enabling cache in SDK

Highlighted
New Member
1 0 0
 

Hi,
now I'm using com.shopify.mobilebuysdk:buy3:4.0.0.  The problem is when I enable the cache it'll throw the exception.

graphClient = GraphClient.Companion.build(app!!.applicationContext, Constants.SHOPIFY_DOMAIN, Constants.SHOPIFY_STOREFRONT_ACCESSTOKEN, configure = {
this.httpClient = httpClient
this.httpCache(getInstance().applicationContext.cacheDir) {
this.cacheMaxSizeBytes = 1024 * 1024 * 10
this.defaultCachePolicy = HttpCachePolicy.Default.CACHE_FIRST.expireAfter(5, TimeUnit.MINUTES)
}
})


Exception is 


java.lang.NoSuchMethodError: No static method create(Lokhttp3/internal/io/FileSystem;Ljava/io/File;IIJ)Lokhttp3/internal/cache/DiskLruCache; in class Lokhttp3/internal/cache/DiskLruCache; or its super classes (declaration of 'okhttp3.internal.cache.DiskLruCache' appears in /data/app/com.vajro.robin-1bM5AytZ_X3gy0mn9gyhIg==/base.apk!classes5.dex)
2020-06-11 17:30:36.599 20824-20824/com.vajro.robin W/System.err: at com.shopify.buy3.internal.cache.DiskLruCacheStore.<init>(DiskLruCacheStore.kt:43)
2020-06-11 17:30:36.599 20824-20824/com.vajro.robin W/System.err: at com.shopify.buy3.GraphClient$Config.build(GraphClient.kt:203)
2020-06-11 17:30:36.599 20824-20824/com.vajro.robin W/System.err: at com.shopify.buy3.GraphClient$Companion.build(GraphClient.kt:132)
2020-06-11 17:30:36.599 20824-20824/com.vajro.robin W/System.err: at com.shopify.buy3.GraphClient$Companion.build(GraphClient.kt:139)
2020-06-11 17:30:36.599 20824-20824/com.vajro.robin W/System.err: at com.vajro.robin.kotlin.MyApplicationKt$Companion.getShopifyClient(MyApplicationKt.kt:137)

0 Likes