Android - No static method - mobilebuysdk

Highlighted
New Member
1 0 0

Hi,

I'm trying to get the mobilebuysdk integrated into my android app, but I'm running into this error. 

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.androappdroid.shopifyapidemo-KKcE6nuBJzECFbi2dRtJ0Q==/base.apk)

 

Here is my code - 

private void initializeGraphClient() {
        OkHttpClient httpClient = new OkHttpClient.Builder()
                .addNetworkInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
                .build();

        graphClient=GraphClient.Companion.build(this,
                SHOP_DOMAIN ,
                API_KEY,
                builder -> {
                    builder.setHttpClient(httpClient);
                    builder.httpCache(getCacheDir(), config -> {
                        config.setCacheMaxSizeBytes(1024 * 1024 * 10);
                        config.setDefaultCachePolicy(HttpCachePolicy.Default.CACHE_FIRST.expireAfter(20, TimeUnit.MINUTES));
                        return Unit.INSTANCE;
                    });
                    return Unit.INSTANCE;
                }, null);
    }

 

 

The SDK version is 7.0.0

 Please do let me know what's the issue or if I'm missing out on something.
TIA.

0 Likes