-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Issue Description
I’ve implemented a simple chat functionality that enables two users to communicate with each other around a specific topic. The flow includes user authentication and initiating a conversation using a backend API. Everything is working seamlessly on iOS devices — users can authenticate, initiate conversations, and exchange messages without any issues.
Version to be used in the application
flutter_twilio_conversations: ^2.0.9+19
Problem
However, when attempting to initiate a conversation from an Android device, the app throws an exception (detailed below). This issue only occurs on Android — the same flow works flawlessly on iOS.
Steps to Reproduce
1. Authenticate the user on Android.
2. Attempt to start a conversation via the backend API.
3. Observe the exception being thrown and stop the application.
Expected Behaviour
Conversation should be initiated successfully, as it does on iOS, and users should be able to exchange messages.
Actual Behaviour
An exception is thrown when initiating the conversation on Android.
Exception Details
D/TwilioInfo(18144): TwilioConversationsPlugin.onMethodCall => received create
D/TwilioInfo(18144): TwilioConversationsPlugin.create => called
D/TwilioInfo(18144): TwilioConversationsPlugin.create => making a fresh ChatClient
D/TwilioInfo(18144): TwilioConversationsPlugin.create => setting Properties.region to 'us1'
D/nativeloader(18144): Load /data/app/~~-mGpaYtknddTdSotBnrcCg==/com.example.chat.development-9yV5euDHiblqc7JTVCI2Pw==/base.apk!/lib/arm64-v8a/libtwilio-convo-native.so using ns clns-7 from class loader (caller=/data/app/~~-mGpaYtknddTdSotBnrcCg==/com.example.chat.development-9yV5euDHiblqc7JTVCI2Pw==/base.apk!classes7.dex): ok
I/ConversationsClientImpl(18144): Twilio Conversations SDK version 6.1.1-db0034ab8
D/CompatChangeReporter(18144): Compat change id reported: 270674727; UID 10207; state: ENABLED
D/TrafficStats(18144): tagSocket(231) with statsTag=0xffffffff, statsUid=-1
I/FLTFireMsgService(18144): FlutterFirebaseMessagingBackgroundService started!
D/EGL_emulation(18144): app_time_stats: avg=62.45ms min=6.00ms max=266.47ms count=16
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=16.88ms min=13.70ms max=28.88ms count=60
W/System.err(18144): SLF4J(W): No SLF4J providers were found.
W/System.err(18144): SLF4J(W): Defaulting to no-operation (NOP) logger implementation
W/System.err(18144): SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
W/ach.development(18144): ApkAssets: Deleting an ApkAssets object '<empty> and /product/app/talkback/talkback.apk' with 1 weak references
W/ach.development(18144): ApkAssets: Deleting an ApkAssets object '/vendor/overlay/EmulatorTalkBackOverlay/EmulatorTalkBackOverlay.apk' with 1 weak references
D/Twilio init success(18144): TwilioConversationsPlugin.create => ChatClient.create onSuccess: myIdentity is 'identity56'
D/TwilioInfo(18144): ChatListener.onClientSynchronization => status = COMPLETED
D/TwilioInfo(18144): ChatListener.onConnectionStateChange => status = CONNECTED
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=1578.57ms min=14.79ms max=7828.33ms count=5
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=60.70ms min=7.13ms max=780.39ms count=17
W/WindowOnBackDispatcher(18144): OnBackInvokedCallback is not enabled for the application.
W/WindowOnBackDispatcher(18144): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=18.26ms min=4.06ms max=93.97ms count=51
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=117.87ms min=15.22ms max=2851.58ms count=28
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=5.29ms min=3.50ms max=19.12ms count=59
E/libEGL (18144): called unimplemented OpenGL ES API
D/EGL_emulation(18144): app_time_stats: avg=3.29ms min=2.28ms max=6.11ms count=61
D/TwilioInfo(18144): TwilioConversationsPlugin.onMethodCall => received Channels#getChannel
D/TwilioInfo(18144): ChannelsMethods.getChannel => onSuccess
D/TwilioInfo(18144): Mapper.channelToMap => EventChannel for Channel(CH179a352ecb5b4532b3358c858de84fbf) attached
D/TwilioInfo(18144): ChannelListener.onSynchronizationChanged => channelSid = CH179a352ecb5b4532b3358c858de84fbf
W/WindowOnBackDispatcher(18144): OnBackInvokedCallback is not enabled for the application.
W/WindowOnBackDispatcher(18144): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
D/TwilioInfo(18144): TwilioConversationsPlugin.onMethodCall => received Channel#getMessagesCount
D/TwilioInfo(18144): ChannelMethods.getMessagesCount => onSuccess
D/TwilioInfo(18144): ChannelMethods.getMessagesCount (Channel.getMessagesCount) => onSuccess: 0
D/TwilioInfo(18144): TwilioConversationsPlugin.onMethodCall => received Members#getMember
D/TwilioInfo(18144): MembersMethods.getMember (Channels.getChannel) => onSuccess
D/AndroidRuntime(18144): Shutting down VM
E/AndroidRuntime(18144): FATAL EXCEPTION: main
E/AndroidRuntime(18144): Process: com.example.chat.development, PID: 18144
E/AndroidRuntime(18144): com.twilio.conversations.ListenerException: Exception thrown by a listener. Your application might have a problem in listener implementation. Listeners must never throw uncaught exceptions. See 'Caused by:' below for more details.
E/AndroidRuntime(18144): at java.lang.reflect.Constructor.newInstance0(Native Method)
E/AndroidRuntime(18144): at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
E/AndroidRuntime(18144): at com.twilio.conversations.internal.RethrowingForwarder$RethrowingProxy.invoke(RethrowingForwarder.java:123)
E/AndroidRuntime(18144): at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
E/AndroidRuntime(18144): at $Proxy3.onSuccess(Unknown Source)
E/AndroidRuntime(18144): at com.twilio.conversations.internal.CallbackListenerForwarder$1.run(CallbackListenerForwarder.java:34)
E/AndroidRuntime(18144): at android.os.Handler.handleCallback(Handler.java:959)
E/AndroidRuntime(18144): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(18144): at android.os.Looper.loopOnce(Looper.java:232)
E/AndroidRuntime(18144): at android.os.Looper.loop(Looper.java:317)
E/AndroidRuntime(18144): at android.app.ActivityThread.main(ActivityThread.java:8705)
E/AndroidRuntime(18144): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18144): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
E/AndroidRuntime(18144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
E/AndroidRuntime(18144): Caused by: java.lang.IllegalStateException: Participants are not available at the moment. Synchronize the conversation first.
E/AndroidRuntime(18144): at com.twilio.conversations.ConversationImpl.getParticipants(ConversationImpl.java:293)
E/AndroidRuntime(18144): at com.twilio.conversations.ConversationImpl.getParticipantsList(ConversationImpl.java:300)
E/AndroidRuntime(18144): at twilio.flutter.twilio_conversations.methods.MembersMethods$getMember$1.onSuccess(MembersMethods.kt:57)
E/AndroidRuntime(18144): at twilio.flutter.twilio_conversations.methods.MembersMethods$getMember$1.onSuccess(MembersMethods.kt:54)
E/AndroidRuntime(18144): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18144): at com.twilio.conversations.internal.RethrowingForwarder$RethrowingProxy.invoke(RethrowingForwarder.java:121)
E/AndroidRuntime(18144): ... 11 more
W/FirebaseCrashlytics(18144): Unable to read App Quality Sessions session id.
Additional Notes
- The authentication token is successfully generated and valid.
- Backend API response is as expected when tested separately.
- No platform-specific code differences identified yet.
flutter doctor -v
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.4 24E248 darwin-arm64, locale
en-IN) [1,130ms]
• Flutter version 3.29.2 on channel stable at
/Users/abc/development/flutter
• Upstream repository https://github.com/flutter/flutter
• Framework revision c236373904 (6 weeks ago), 2025-03-13 16:17:06 -0400
• Engine revision 18b71d647a
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.3s]
• Android SDK at /Users/abc/Library/Android/sdk/
• Platform android-35, build-tools 35.0.0
• ANDROID_HOME = /Users/abc/Library/Android/sdk
• Java binary at: /opt/homebrew/Cellar/openjdk@17/17.0.13/libexec/openjdk.jdk/Contents/Home/bin/java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment Homebrew (build 17.0.13+0)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [2.0s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [22ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.2) [22ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
[✓] IntelliJ IDEA Community Edition (version 2024.3.1) [21ms]
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] Connected device (5 available) [6.3s]
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 15 (API 35) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4 24E248 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 15.4 24E248 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 135.0.7049.96
[✓] Network resources [470ms]
• All expected network resources are available.
• No issues found!