Synerise / android-sdk

Synerise SDK for Android
9 stars 8 forks source link

Error while processing definitions: Unable to create call adapter for class lv.e for method ClientAccountApi.a #15

Closed Adham32 closed 3 months ago

Adham32 commented 3 months ago

Hi, I have an error in version 5.19.0. Synerise SDK E Error while processing definitions: Unable to create call adapter for class lv.e for method ClientAccountApi.a

So Synerise can't build properly. If it helps, I also see something like this in logs:

Screenshot 2024-07-10 at 15 25 20
konned commented 3 months ago

Hi, Please provide more information: android version, what do you mean by "Synerise can't build properly" ? Are you using workManager in your app?

Adham32 commented 3 months ago

@konned Everything works fine on the debug version. Events are created, then Synerise worker sends them and they are visible in the Synerise web panel. However, when I build the application in the release version - with code obfuscation. Some problem arises in the sdk - and the worker for sending events does not work at all ( does not send them) and In-app messages are not displayed either.

about Android versions: minSdk = 26 target = 34

konned commented 3 months ago

What proguard rules do you have? Do you have R8 full mode enabled?

Adham32 commented 3 months ago

@konned

-keep class okhttp3.** { *; }
-dontwarn okhttp3.**
-dontwarn okio.**

# keep entire Synerise SDK
-keep class com.synerise.sdk.** { *; }
-keepclassmembers class com.synerise.sdk.** { *; }
-keepclassmembers class com.synerise.sdk.** {
    public <init>();
}

-dontwarn org.joda.convert.FromString
-dontwarn org.joda.convert.ToString
-keep @org.joda.convert.FromString class *
-keepclassmembers class * {
    @org.joda.convert.FromString *;
}
-keep @org.joda.convert.ToString class *
-keepclassmembers class * {
    @org.joda.convert.ToString *;
}

We don't use Retrofit lib in our app - maybe this will be a problem?

buildTypes { release { isMinifyEnabled = true } }

konned commented 3 months ago

buildTypes { release { isMinifyEnabled = true } } this is ok. Check gradle.properties file

Adham32 commented 3 months ago
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
konned commented 3 months ago

Try adding this: android.enableR8.fullMode=false

Adham32 commented 3 months ago

ok thanks @konned now it works