From 53416c90070e5f5b19902136f39aa37048ee9ff4 Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Mon, 10 Jul 2023 18:04:35 +0800 Subject: [PATCH 1/2] fix: [android] Fix reset the log file in RtcEngine.initialize cause incorrect log file path --- lib/src/impl/agora_rtc_engine_impl.dart | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/src/impl/agora_rtc_engine_impl.dart b/lib/src/impl/agora_rtc_engine_impl.dart index 9d29a5eb6..0d3398d8a 100644 --- a/lib/src/impl/agora_rtc_engine_impl.dart +++ b/lib/src/impl/agora_rtc_engine_impl.dart @@ -259,11 +259,8 @@ class RtcEngineImpl extends rtc_engine_ex_binding.RtcEngineExImpl _initializingCompleter = Completer(); engineMethodChannel = const MethodChannel('agora_rtc_ng'); - String externalFilesDir = ''; if (defaultTargetPlatform == TargetPlatform.android) { - final androidInitResult = - await engineMethodChannel.invokeMethod('androidInit'); - externalFilesDir = androidInitResult['externalFilesDir'] ?? ''; + await engineMethodChannel.invokeMethod('androidInit'); } List args = []; @@ -284,16 +281,6 @@ class RtcEngineImpl extends rtc_engine_ex_binding.RtcEngineExImpl jsonEncode({'appType': 4}), )); - if (externalFilesDir.isNotEmpty) { - try { - // Reset the sdk log file to ensure the iris log path has been set - await setLogFile('$externalFilesDir/agorasdk.log'); - } catch (e) { - debugPrint( - '[RtcEngine] setLogFile fail, make sure the permission is granted.'); - } - } - _rtcEngineState.isInitialzed = true; _isReleased = false; _initializingCompleter?.complete(null); From 58a5ad9603286cd64bd4570d693cf61dbfb2a0ed Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Mon, 10 Jul 2023 18:12:57 +0800 Subject: [PATCH 2/2] ++ --- lib/src/impl/agora_rtc_engine_impl.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/src/impl/agora_rtc_engine_impl.dart b/lib/src/impl/agora_rtc_engine_impl.dart index 0d3398d8a..89dace963 100644 --- a/lib/src/impl/agora_rtc_engine_impl.dart +++ b/lib/src/impl/agora_rtc_engine_impl.dart @@ -35,8 +35,7 @@ import 'package:agora_rtc_engine/src/impl/native_iris_api_engine_binding_delegat import 'package:flutter/foundation.dart' show ChangeNotifier, defaultTargetPlatform; import 'package:flutter/services.dart' show MethodChannel; -import 'package:flutter/widgets.dart' - show VoidCallback, TargetPlatform, debugPrint; +import 'package:flutter/widgets.dart' show VoidCallback, TargetPlatform; import 'package:iris_method_channel/iris_method_channel.dart'; import 'package:meta/meta.dart';