exponea / exponea-react-native-sdk

MIT License
8 stars 13 forks source link

InAppMessageManagerImpl: Preloading in-app messages failed. canceled due to java.lang.NoSuchMethodError #41

Closed Vasant-Patel closed 2 years ago

Vasant-Patel commented 2 years ago

Hi,

Our app is crashing on Android with following issue; ReactNative 0.64.2 Android 10 compileSdkVersion = 29 targetSdkVersion = 30

2021-11-30 12:46:41.958 4402-4561/? E/InAppMessageManagerImpl: Preloading in-app messages failed. canceled due to java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/fi.our.app.id-9EcctlflKLk0Oi6BfiHxOA==/base.apk!classes3.dex)
2021-11-30 12:46:41.963 4402-4561/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: fi.our.app.id, PID: 4402
    java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/fi.our.app.id-9EcctlflKLk0Oi6BfiHxOA==/base.apk!classes3.dex)
        at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:114)
        at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:173)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-11-30 12:46:41.975 4402-4563/? E/InAppMessageManagerImpl: Preloading in-app messages failed. canceled due to java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/fi.our.app.id-9EcctlflKLk0Oi6BfiHxOA==/base.apk!classes3.dex)
2021-11-30 12:46:41.979 4402-4563/? E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: fi.our.app.id, PID: 4402
    java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/fi.our.app.id-9EcctlflKLk0Oi6BfiHxOA==/base.apk!classes3.dex)
        at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:114)
        at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:173)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
michaela-dev commented 2 years ago

Hi, thanks for the report. The current SDK version is not supporting targeting Android 12, new version release is planned with these changes. We will try to publish ASAP.

michaela-dev commented 2 years ago

This was caused by different versions of the OkHttp library used by our native Android SDK and RN SDK. Error should not occur anymore on the new RN SDK version 1.0.0.