From 3f0a6c7c470a362493273ca45b69eab52f580061 Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 9 Dec 2025 16:18:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(android):=20=E6=8C=87=E5=AE=9A=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E7=9A=84NDK=E7=89=88=E6=9C=AC=E4=BB=A5=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在build.gradle.kts中硬编码NDK版本为27.0.12077973 - 添加注释说明覆盖flutter.ndkVersion的原因 - 确保项目使用系统上实际存在的NDK版本进行构建 feat(im): 增加消息发送成功与失败的日志记录 - 在IMManager中注册ChatMessageEvent监听器 - 记录发送消息成功的日志信息 - 记录发送消息失败时的错误详情和描述 fix(ui): 页面返回时关闭SmartDialog提示框 - 在LiveRoomPage的onPopInvokedWithResult回调中调用SmartDialog.dismiss() - 防止页面切换时残留对话框影响用户体验 --- android/app/build.gradle.kts | 4 +++- lib/im/im_manager.dart | 9 ++++++++- lib/pages/discover/live_room_page.dart | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 77dd3e4..cf1689d 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -8,7 +8,9 @@ plugins { android { namespace = "com.juxinghe.touchme" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + // Use a specific NDK version that is available on the system + // If flutter.ndkVersion points to a missing/corrupted NDK, override it + ndkVersion = "27.0.12077973" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 diff --git a/lib/im/im_manager.dart b/lib/im/im_manager.dart index 803cb06..f44cff5 100644 --- a/lib/im/im_manager.dart +++ b/lib/im/im_manager.dart @@ -132,7 +132,14 @@ class IMManager { }, ), ); - + EMClient.getInstance.chatManager.addMessageEvent(_chatHandlerKey, ChatMessageEvent( + onSuccess: (str, message){ + Get.log('✅ [IMManager] 发送消息成功: $str'); + }, + onError: (str, message, err){ + Get.log('❌ [IMManager] 发送消息失败: $err----$str'); + }, + )); _listenersRegistered = true; if (Get.isLogEnable) { Get.log('✅ [IMManager] 监听器注册成功'); diff --git a/lib/pages/discover/live_room_page.dart b/lib/pages/discover/live_room_page.dart index 233fc11..4626d73 100644 --- a/lib/pages/discover/live_room_page.dart +++ b/lib/pages/discover/live_room_page.dart @@ -107,6 +107,7 @@ class _LiveRoomPageState extends State { Widget build(BuildContext context) { return PopScope( onPopInvokedWithResult: (bool didPop, Object? result) async { + SmartDialog.dismiss(); _overlayController.show(); Get.back(); },