Skip to content

Commit b437bee

Browse files
authored
fix: [android] Fix reset the log file in RtcEngine.initialize cause incorrect log file path (#1201)
fix: [android] Fix reset the log file in RtcEngine.initialize cause incorrect log file path (#1201)
1 parent db57e87 commit b437bee

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

lib/src/impl/agora_rtc_engine_impl.dart

+2-16
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ import 'package:agora_rtc_engine/src/impl/native_iris_api_engine_binding_delegat
3535
import 'package:flutter/foundation.dart'
3636
show ChangeNotifier, defaultTargetPlatform;
3737
import 'package:flutter/services.dart' show MethodChannel;
38-
import 'package:flutter/widgets.dart'
39-
show VoidCallback, TargetPlatform, debugPrint;
38+
import 'package:flutter/widgets.dart' show VoidCallback, TargetPlatform;
4039
import 'package:iris_method_channel/iris_method_channel.dart';
4140
import 'package:meta/meta.dart';
4241

@@ -259,11 +258,8 @@ class RtcEngineImpl extends rtc_engine_ex_binding.RtcEngineExImpl
259258
_initializingCompleter = Completer<void>();
260259
engineMethodChannel = const MethodChannel('agora_rtc_ng');
261260

262-
String externalFilesDir = '';
263261
if (defaultTargetPlatform == TargetPlatform.android) {
264-
final androidInitResult =
265-
await engineMethodChannel.invokeMethod('androidInit');
266-
externalFilesDir = androidInitResult['externalFilesDir'] ?? '';
262+
await engineMethodChannel.invokeMethod('androidInit');
267263
}
268264

269265
List<int> args = [];
@@ -284,16 +280,6 @@ class RtcEngineImpl extends rtc_engine_ex_binding.RtcEngineExImpl
284280
jsonEncode({'appType': 4}),
285281
));
286282

287-
if (externalFilesDir.isNotEmpty) {
288-
try {
289-
// Reset the sdk log file to ensure the iris log path has been set
290-
await setLogFile('$externalFilesDir/agorasdk.log');
291-
} catch (e) {
292-
debugPrint(
293-
'[RtcEngine] setLogFile fail, make sure the permission is granted.');
294-
}
295-
}
296-
297283
_rtcEngineState.isInitialzed = true;
298284
_isReleased = false;
299285
_initializingCompleter?.complete(null);

0 commit comments

Comments
 (0)