CleverTap / clevertap-android-sdk

CleverTap Android SDK
MIT License
80 stars 74 forks source link

fatal exception ClassNotFoundException "org.jacoco.agent.rt.internal_28bab1d.Offline" after updating to 4.5.0 #290

Closed fugogugo closed 2 years ago

fugogugo commented 2 years ago

Today I just upgraded clevertap from 4.2.0 to 4.5.0 and when I build the app, after launching it instantly crashed with following eror

FATAL EXCEPTION: main

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.internal_28bab1d.Offline" on path: DexPathList[[zip file "/data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/base.apk"],nativeLibraryDirectories=[/data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/lib/arm64, /data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]

FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_28bab1d/Offline;
    at com.clevertap.android.sdk.ActivityLifecycleCallback.$jacocoInit(Unknown Source:13)
    at com.clevertap.android.sdk.ActivityLifecycleCallback.<clinit>(Unknown Source:0)
    at com.clevertap.android.sdk.ActivityLifecycleCallback.register(Unknown Source:0)
    at coffee.fore2.fore.ForeApplication.onCreate(ForeApplication.kt:16)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1193)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6995)
    at android.app.ActivityThread.access$1600(ActivityThread.java:257)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1993)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:236)
    at android.app.ActivityThread.main(ActivityThread.java:8057)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.internal_28bab1d.Offline" on path: DexPathList[[zip file "/data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/base.apk"],nativeLibraryDirectories=[/data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/lib/arm64, /data/app/~~fRF6xepWmDDbBm_DdFU20w==/coffee.fore2.fore.dev-jUniVy8T9DD7xSjurRVI_w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 14 more

so far I only change gradle clevertap from 4.2.0 to 4.5.0 and gradle ext.kotlin_version = '1.3.61' to ext.kotlin_version = '1.6.0'

what is this jacoco agent library? do I need to implement some library to gradle?

Environment :

root-ansh-ct commented 2 years ago

Hey @fugogugo thanks for reporting this. are you using the clevertap sdk directly via AAR or via maven central (i.e adding implementation "com.clevertap.android:clevertap-android-sdk:4.5.0" to gradle dependencies) ? also is the app native or hybrid( react-native/flutter/ etc?)

gaurav-zdroid commented 2 years ago

Hey @root-ansh-ct I am also facing same issue, I am using SDK via implementation "com.clevertap.android:clevertap-android-sdk:4.5.0"

and this app is native (Kotlin)

fugogugo commented 2 years ago

same with @gaurav-zdroid I am using native android , kotlin, android studio IDE, and gradle dependency

root-ansh-ct commented 2 years ago

@gaurav-zdroid , @fugogugo i was able to replicate this issue in a slightly different environment. We are trying a fix which includes disabling the jacoco plugin for release AARs, which will become part of upcoming SDK v4.5.1 .

For now, can you try using this local snapshot of 4.5.1 AAR and let me know if the issue resolves?

Steps:

  1. Download this AAR file and add it to your project's app/libs folder
  2. in your app's build.gradle, add :

dependencies { implementation fileTree(include: ['.jar', '.aar'], dir: 'libs') implementation files('libs/clevertap-android-sdk-4.5.1.aar') // implementation "com.clevertap.android:clevertap-android-sdk:4.5.0". //<-- comment for now }



3. Clean Project, delete ,`.gradle` folder, invalidate cache and restart
4. build and run the app
fugogugo commented 2 years ago

@root-ansh-ct sorry I got this error when building

what is this?


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDevDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.clevertap.android.sdk.ActivityLifecycleCallback found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.ActivityLifecycleCallback$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.Application found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.BuildConfig found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CTFeatureFlagsListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CTInboxListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CTInboxStyleConfig found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CTInboxStyleConfig$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CTWebInterface found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$10 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$11 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$12 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$13 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$14 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$15 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$16 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$3 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$4 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$5 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$6 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$7 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$8 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$9 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$DevicePushTokenRefreshListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapAPI$LogLevel found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapInstanceConfig found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.CleverTapInstanceConfig$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.Constants found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.DeviceInfo found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.DeviceInfo$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.DeviceInfo$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.DeviceInfo$DeviceCachedInfo found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppFCManager found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$3 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$4 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$5 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationActivity$6 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationButtonListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InAppNotificationListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.InboxMessageButtonListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.LocalDataStore found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.LocalDataStore$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.LocalDataStore$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.LocalDataStore$3 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.Logger found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.ManifestInfo found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.StorageHelper found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.SyncListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.UTMDetail found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.Utils found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.CTDisplayUnitController found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.CTDisplayUnitType found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.DisplayUnitListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.model.CleverTapDisplayUnit found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.model.CleverTapDisplayUnit$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.model.CleverTapDisplayUnitContent found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.displayunits.model.CleverTapDisplayUnitContent$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.featureFlags.CTFeatureFlagConstants found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.featureFlags.CTFeatureFlagsController found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.featureFlags.CTFeatureFlagsController$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.featureFlags.CTFeatureFlagsController$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.featureFlags.CTFeatureFlagsController$3 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigConstants found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$3 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$4 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$5 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$6 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$7 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigController$PROCESSING_STATE found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.CTProductConfigListener found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.DefaultXmlParser found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.ProductConfigSettings found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.ProductConfigSettings$1 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.ProductConfigSettings$2 found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)
     Duplicate class com.clevertap.android.sdk.product_config.ProductConfigUtil found in modules jetified-clevertap-android-sdk-3.8.0-runtime (com.clevertap.android:clevertap-android-sdk:3.8.0) and jetified-clevertap-android-sdk-4.5.1-runtime (clevertap-android-sdk-4.5.1.aar)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 20s

I already invalidate cache & restart and delete .gradle/ folder

fugogugo commented 2 years ago

oh wait nevermind I deleted the wrong gradle folder. trying again now

root-ansh-ct commented 2 years ago

@fugogugo make sure to remove all the instances of implementation of clevertap's SDK via maven central . from the logs, it seems that you are having implementation "com.clevertap.android:clevertap-android-sdk:3.8.0" somewhere.

Also, ensure that in project view , when you open external libraries , it shows something like ./app/libs/clevertap-core-sdk-4.5.1 and not com.clevertap.android.clevertap-android sdk-4.5.0 or any other version. This might take a few gradle clean and cache invalidations

image image
fugogugo commented 2 years ago

that's what I'm confused.. I have removed all clevertap implementation but it still error somehow. I don't even use clevertap 3.8.0

here is all my gradle dependency fyi


dependencies {

    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.json:json:20211205'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
    implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
    implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
    implementation 'com.jakewharton.rxbinding4:rxbinding-core:4.0.0'
    implementation 'com.jakewharton.rxbinding4:rxbinding-appcompat:4.0.0'

    implementation 'ru.tinkoff.scrollingpagerindicator:scrollingpagerindicator:1.2.1'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation 'com.github.poovamraj:PinEditTextField:1.2.6'
    implementation "com.google.android.flexbox:flexbox:3.0.0"

    implementation 'com.airbnb.android:lottie:3.4.1'
    implementation "com.ncorti:slidetoact:0.8.0"
    // Navigation dependencies
    def nav_version = "2.3.0-alpha03"
    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
    implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"
    androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"

    implementation "androidx.activity:activity:1.2.0"
    implementation "androidx.fragment:fragment:1.3.0"

    def lifecycle_version = "2.2.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
    implementation "android.arch.lifecycle:extensions:1.1.1"
    annotationProcessor "android.arch.lifecycle:compiler:1.1.1"

    // Networking dependencies
    implementation "com.squareup.okhttp3:okhttp:4.4.0"

    // Image download & cache dependencies.
    def glide_version = "4.11.0"
    implementation "com.github.bumptech.glide:glide:$glide_version"
    kapt "com.github.bumptech.glide:compiler:$glide_version"

    implementation "com.facebook.shimmer:shimmer:0.5.0"

    implementation "com.google.android.gms:play-services-location:17.0.0"
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    implementation "com.google.android.libraries.places:places:2.2.0"
    implementation "com.google.maps.android:android-maps-utils:1.0.2"
    implementation 'com.android.volley:volley:1.2.0'

    // QR code dependencies, downgraded to support older devices.
    implementation("com.journeyapps:zxing-android-embedded:4.2.0") { transitive = false }
    implementation "com.google.zxing:core:3.3.2"

    devImplementation 'com.midtrans:uikit:1.30.1-SANDBOX' // change the number to the latest version
    productionImplementation 'com.midtrans:uikit:1.30.1'
    implementation files('../libs/clevertap-android-sdk-4.5.1.aar')
    //    implementation "com.clevertap.android:clevertap-android-sdk:4.5.0". //<-- comment for now
//    implementation 'com.clevertap.android:clevertap-android-sdk:4.4.0'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    implementation 'com.google.firebase:firebase-crashlytics:17.1.0'

    implementation 'com.google.android.gms:play-services-base:17.4.0'
    implementation 'com.android.installreferrer:installreferrer:1.0' // Mandatory for v3.6.4 and above
    implementation 'com.appsflyer:af-android-sdk:5.4.0'
    implementation "com.midtrans:gopay-checkout:0.1.5"

    implementation 'com.github.NightWhistler:HtmlSpanner:0.4'

    def flipper_version = "0.125.0"
    debugImplementation "com.facebook.flipper:flipper:$flipper_version"
    debugImplementation "com.facebook.flipper:flipper-network-plugin:$flipper_version"
    debugImplementation "com.facebook.soloader:soloader:0.9.0"

    implementation 'com.google.android.play:core:1.10.0'
    implementation 'com.google.android.play:core-ktx:1.8.1'

    // Wheel picker view library (currently used for gender / date picker)
    // Link: https://github.com/AigeStudio/WheelPicker
    implementation project(":libs:WheelPicker")
    implementation project(":libs:loopingviewpager")
//
//    //clevertap app inbox requirement
    implementation "com.google.android.exoplayer:exoplayer:2.15.1"
    implementation "com.google.android.exoplayer:exoplayer-hls:2.15.1"
    implementation "com.google.android.exoplayer:exoplayer-ui:2.15.1"

    //CircleIndicator
    implementation 'me.relex:circleindicator:2.1.6'

}

======

Hmm I think I kinda understand the problem, I need to delete the entire .gradle folder instead of cache folder only

I will continue trying tomorrow.. it tooks very long time to redownload everything @__@ at least it currently work with 4.4.0

root-ansh-ct commented 2 years ago

yes .gradle is needed to be regenerated . This whole process will not be needed once we make the official v4.5.1 release. Please let me know if the AAR works after regenerating the .gradle . you can also check the various dependencies in your app by running gradle command gradlew :app:dependencies . do share the dependency tree if the error still persists

fugogugo commented 2 years ago

Hello

I have tried multiple times and it still duplicate. it's okay I guess I will stay with 4.4.0 currently it is working well and no breaking I will wait until 4.5.1 goes live.. you can close this issue if it is fixed :)

root-ansh-ct commented 2 years ago

@fugogugo we releases android 4.5.1 yesterday. can you revert all the above steps and try with 4.5.1 version from the maven central now?

implementation "com.clevertap.android:clevertap-android-sdk:4.5.1"
fugogugo commented 2 years ago

Hello,

yes thank you I just tried it with 4.5.1 and it work as intended. no crash, event log received, and push notif can be sent thank you