Xamarin Bindings to Intercom SDK ClassNotFoundException

Hi All,

I've been researching Xamarin native bindings over the past weeks and trying to implement a proper Xamarin Binding for Intercom's SDK v5.5.1.

For Intercoms SDK I have 4 AARs which I include in 4 different projects.

Binding.Android.Intercom.Base
Binding.Android.Intercom.Composer
Binding.Android.Intercom.Composer.Gallery
Binding.Android.Intercom.FCM

Base references -> composer + gallery
composer.gallery references -> composer
FCM references -> Base

All the relevant nuget packages for android.support... have been installed in reference to maven's list of required dependencies.

The application will build successfully and run successfully, however when I initialise the SDK I receive a crash with a ClassNotFoundException. Here is the runtime logs.

Here is the snippet in question of the stacktrace:

[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: com.esqimo.testqimo, PID: 17957
[AndroidRuntime] java.lang.NoClassDefFoundError: Failed resolution of: Lcom/intercom/composer/ComposerFragment;
[AndroidRuntime]    at io.intercom.android.sdk.utilities.ActivityUtils.<clinit>(ActivityUtils.java:20)
[AndroidRuntime]    at io.intercom.android.sdk.utilities.ActivityUtils.isHostActivity(ActivityUtils.java:27)
[AndroidRuntime]    at io.intercom.android.sdk.store.OverlayStateReducer.reduce(OverlayStateReducer.java:83)
[AndroidRuntime]    at io.intercom.android.sdk.store.OverlayStateReducer.reduce(OverlayStateReducer.java:25)
[AndroidRuntime]    at io.intercom.android.sdk.store.StateReducer.reduce(StateReducer.java:56)
[AndroidRuntime]    at io.intercom.android.sdk.store.StateReducer.reduce(StateReducer.java:16)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$1.dispatch(Store.java:49)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$2.dispatch(Store.java:66)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.OperatorClientConditionsMiddleware.dispatch(OperatorClientConditionsMiddleware.java:41)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.MetricTrackerMiddleware.dispatch(MetricTrackerMiddleware.java:46)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.AppConfigMiddleware.dispatch(AppConfigMiddleware.java:24)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.UserIdentityMiddleware.dispatch(UserIdentityMiddleware.java:19)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.FirstMessageMiddleware.dispatch(FirstMessageMiddleware.java:29)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.AudioMiddleware.dispatch(AudioMiddleware.java:32)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.OverlayPresenterMiddleware.dispatch(OverlayPresenterMiddleware.java:61)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.NexusClientMiddleware.dispatch(NexusClientMiddleware.java:30)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.UserUpdateBatcherMiddleware.dispatch(UserUpdateBatcherMiddleware.java:28)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.ApiMiddleware.dispatch(ApiMiddleware.java:20)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.middleware.LoggerMiddleware.dispatch(LoggerMiddleware.java:20)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store$3.dispatch(Store.java:74)
[AndroidRuntime]    at io.intercom.android.sdk.store.Store.dispatch(Store.java:81)
[AndroidRuntime]    at io.intercom.android.sdk.ActivityLifecycleHandler.handleMessage(ActivityLifecycleHandler.java:39)
[AndroidRuntime]    at android.os.Handler.dispatchMessage(Handler.java:105)
[AndroidRuntime]    at android.os.Looper.loop(Looper.java:164)
[AndroidRuntime]    at android.app.ActivityThread.main(ActivityThread.java:6541)
[AndroidRuntime]    at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime]    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
[AndroidRuntime]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "com.intercom.composer.ComposerFragment" on path: DexPathList[[zip file "/data/app/com.esqimo.testqimo-AV7moq5paYKBpXoH7a4JYw==/base.apk"],nativeLibraryDirectories=[/data/app/com.esqimo.testqimo-AV7moq5paYKBpXoH7a4JYw==/lib/x86, /data/app/com.esqimo.testqimo-AV7moq5paYKBpXoH7a4JYw==/base.apk!/lib/x86, /system/lib, /vendor/lib]]
[AndroidRuntime]    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[AndroidRuntime]    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[AndroidRuntime]    ... 38 more
Loaded assembly: System.Runtime.Serialization.dll [External]

The weirdest thing is that I can literally see the ComposerFragment class in the obj folder of my app.

Anyone know anything that could point me in the right direction?

Tagged:

Best Answer

  • JamesMallonJamesMallon US ✭✭
    Accepted Answer

    @RodrigoLira This happens in development + release builds. I also am not using ProGuard as of yet.

    I have now resolved the issue. The issue was difference in package versions that were embedded in packages and the build works successfully.

Answers

  • RodrigoLiraRodrigoLira USMember ✭✭

    This may be a long shot, but does this also happens in development? I'm asking because since my last update, I'm having Linker/ProGuard problems.

  • JamesMallonJamesMallon USMember ✭✭
    Accepted Answer

    @RodrigoLira This happens in development + release builds. I also am not using ProGuard as of yet.

    I have now resolved the issue. The issue was difference in package versions that were embedded in packages and the build works successfully.

Sign In or Register to comment.