CleverTap / clevertap-android-sdk

CleverTap Android SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crashes after updating Clevertap SDK to v4.6.3

anugotta opened this issue · comments

Saw these crashes reported in Firebase console post updating Clevertap SDK to v4.6.3 and releasing the app bundle to Playstore.

Fatal Exception: java.lang.RuntimeException: Unable to instantiate service com.clevertap.android.sdk.CTBackgroundJobService: java.lang.ClassNotFoundException: Didn't find class "com.clevertap.android.sdk.CTBackgroundJobService" on path: DexPathList[[zip file "/data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/base.apk", zip file "/data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/split_config.arm64_v8a.apk", zip file "/data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/lib/arm64, /data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/base.apk!/lib/arm64-v8a, /data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/wellthy.care-GWJE3Dkow56FlBL38ze-Rw==/split_config.xxhdpi.apk!/lib/arm64-v8a, /system/lib64]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3755)
at android.app.ActivityThread.access$1400(ActivityThread.java:240)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1813)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7094)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

Environment (please complete the following information):

  • Device: Multiple devices e.g Galaxy A80, realme 7 etc
  • OS: Android 9, 12
  • CleverTap SDK Version : v4.6.3
  • Android Studio Version :
    Android Studio Chipmunk | 2021.2.1 Patch 2
    Build #AI-212.5712.43.2112.8815526, built on July 10, 2022

@anugotta Are you using Proguard to minify your App bundle? if yes, can you share your Proguard file?

Yes, @darshanclevertap . We are using minify. Here is the Proguard.pro file content:

-verbose

-keepattributes JavascriptInterface
-keepattributes *Annotation*
-ignorewarnings
-dontwarn com.akexorcist.roundcornerprogressbar.TextRoundCornerProgressBar
-dontwarn com.google.errorprone.annotations.**
-keep class android.widget.**
-dontnote android.support.*
-dontnote com.google.android.*
-dontwarn android.util.FloatProperty
-dontwarn android.util.IntProperty
-dontwarn wellthy.care.*
-keep class java.util.TimeZone
-keep class com.google.firebase.**


-optimizationpasses 6
-assumenosideeffects class android.util.Log {
 public static *** d(...);
 public static *** i(...);
 public static *** v(...);
}

-keepattributes InnerClasses
-keepclassmembers class * {
     private <fields>;
 }
-keepclassmembers enum * { *; }
-dontskipnonpubliclibraryclassmembers
-keep class android.animation.ObjectAnimator

## This is for MPAndroidChart
-keep class com.github.mikephil.charting.** { *; }


-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep class com.bumptech.glide.GeneratedAppGlideModuleImp

 -keep class  kotlinx.coroutines.**
 -keep class koltinx.coroutines.**{*;}
 -keep class org.jetbrains.**
 -keep class koltinx.coroutines.**{*;}



 -keep public class com.myapp.customcomponents.**

 # For CleverTap SDK
 -dontwarn com.clevertap.android.sdk.**

  -keep class android.opengl.** {*;}


-keep  class javax.microedition.khronos.** {*;}



@anugotta Can you change -dontwarn com.clevertap.android.sdk.** to -keep com.clevertap.android.sdk.**

And try it in your next App release to see if the crash still occurs?

Sure. Will try and let you know. Thanks.

@anugotta Closing this since a workaround is given. Feel free to reopen this if you face the issue again