clevertap-android-sdk icon indicating copy to clipboard operation
clevertap-android-sdk copied to clipboard

In-App not show when isMinifyEnabled = true

Open niuzai0222 opened this issue 1 year ago • 2 comments

Describe the bug "When I set isMinifyEnabled = false, the in-app displays correctly. However, when isMinifyEnabled = true, the in-app does not display, and there is an error message:

Unable to parse inapp notification Invalid JSONJSONObject["ti"] is not a string (class java.lang.Integer : 1721812767).

Here are more log details:

image

To Reproduce

Environment (please complete the following information):

  • Device: [SamSung,xiaomi]
  • OS: [Android13,Android14]
  • CleverTap SDK Version [com.clevertap.android:clevertap-android-sdk v6.2.1]
  • Android Studio Version [Android Studio Koala | 2024.1.1 Patch ]
  • compileSdk [34]
  • AGP [8.5.0]
  • androidx.core [1.10.1]

niuzai0222 avatar Jul 29 '24 07:07 niuzai0222

I think obfuscation can be avoided for CleverTap sdk as such : -keep com.clevertap.android.sdk.**

It seems minifyEnabled is obfuscating the model classes and hence this issue is happening.

CTLalit avatar Jul 29 '24 11:07 CTLalit

It seems the issue was related to JSON parsing for CleverTap. Adding -keep class org.json.** { *; } solved the problem.

niuzai0222 avatar Aug 02 '24 02:08 niuzai0222