Legacy Dev Forum Posts

 View Only

Sign Up

Attachments handling in Android SDK

  • 1.  Attachments handling in Android SDK

    Posted 06-05-2025 18:38

    spchatbot | 2024-11-28 11:25:22 UTC | #1

    Hi team, We are using v1.10.2 of Genesys Mobile SDK on Android. We haven't defined a File Provider in our case and do not have Read External Storage / Media access permissions on our Manifest. We are targeting API 28.

    We are seeing a Illegal Argument Exception with the this path

    /data/data/-package-name-/cache/Genesys-Mobile-Messenger-SDK/attachments/9b1dbe2a-8eba-44d5-b81a-53cf62f2af2f.ebe7443b-c6bc-40d0-b4bb-80a6b66f02b0.png

    at com.genesys.cloud.ui.messenger.MessengerChatUIHandler.openFile.

    Looks like users are not able to upload(incoming) attachments via the chatbot. Although we can see that the release notes for v1.10.2 seems to address this issue, we are still seeing it.

    Please confirm a approach to resolve this issue.

    Thanks, team - spchatbot


    tamasi878 | 2024-11-28 14:28:52 UTC | #2

    Hi,

    Thank you for contacting us. We will investigate the issue, and get back to you asap.


    tamasi878 | 2024-11-28 15:31:45 UTC | #3

    Hi,

    Can you please provide the exact steps to reproduce it, and the logs from the Android Studio console? To get the logs, you need to create the MessagingClient with parameter logging = true.

    Thank you.


    spchatbot | 2024-11-29 12:48:19 UTC | #4

    Hi,

    We have had a chance to reproduce this at our end.

    We are getting the crash when user clicks on an image or attachment sent by the chatbot/agent.

    Thanks, spchatbot

    Here is the Crash Log:

    Crashlytics - Stack trace Application: package name Platform: android Date: Tue Nov 26 2024 09:22:48 GMT+0000 (Greenwich Mean Time)

    Fatal Exception: java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/package-name/cache/Genesys-Mobile-Messenger-SDK/attachments/9b1dbe2a-8eba-44d5-b81a-53cf62f2af2f.ebe7443b-c6bc-40d0-b4bb-80a6b66f02b0.png at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:867) at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:467) at com.genesys.cloud.ui.messenger.MessengerChatUIHandler.openFile(MessengerChatUIHandler.kt:371) at com.genesys.cloud.ui.messenger.MessengerChatUIHandler.handleEvent(MessengerChatUIHandler.kt:632) at com.genesys.cloud.ui.structure.handlers.BaseChatUIHandler$chatViewModel$2.invoke$lambda$4$lambda$3$lambda$2$lambda$1(BaseChatUIHandler.java:200) at com.genesys.cloud.ui.utils.SingleLiveData.observe$lambda$0(SingleLiveData.java:101) at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133) at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:151) at androidx.lifecycle.LiveData.setValue(LiveData.java:309) at com.genesys.cloud.ui.fragments.ChatViewModel.onHandleEvent(ChatViewModel.java:123) at com.genesys.cloud.ui.fragments.ChatViewModel$elementControllerFactory$1$produceController$1$1.invoke(ChatViewModel.kt:145) at com.genesys.cloud.ui.fragments.ChatViewModel$elementControllerFactory$1$produceController$1$1.invoke(ChatViewModel.kt:145) at com.genesys.cloud.ui.structure.elements.ChatUIElementController.handleEvent(ChatUIElementController.kt:52) at com.genesys.cloud.ui.views.chatelement.BubbleContentHolder.updateAttachmentLayout$lambda$7$lambda$6(BubbleContentHolder.java:267) at android.view.View.performClick(View.java:8047) at android.view.View.performClickInternal(View.java:8024) at android.view.View.-$$Nest$mperformClickInternal() at android.view.View$PerformClick.run(View.java:31890) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.app.ActivityThread.main(ActivityThread.java:8919) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)


    tamasi878 | 2024-12-04 11:52:31 UTC | #5

    Thank you for the detailed information. We created a ticket and will start to investigate it on our next sprint.


    system | 2025-01-03 11:53:01 UTC | #6

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 30610