AgoraIO-Extensions / AgoraIO-Extensions/Agora-Flutter-SDK
iOS Crash (EXC_BAD_ACCESS) after calling joinChannel() in Agora SDK
- Lingua principale
- Dart
- Stelle
- 795
- Fork
- 448
- Merge medio
- 12h 19m
- PR unite (30g)
- 14
Descrizione
### Version of the agora_rtc_engine
6.5.3
### Platforms affected
- [ ] Android
- [x] iOS
- [ ] macOS
- [ ] Windows
- [ ] Web
### Steps to reproduce
Suddenly, my app started crashing on iOS a few days ago. It is difficult to determine exactly whether this was caused by an iOS update or an Xcode update. Android works perfectly fine. (Since it works well on Android, I couldn't pinpoint exactly when the iOS issue began.)
The crash occurs after the await _engine.joinChannel() call. I confirmed that the log statements placed immediately after the await line are executed.
My Hypothesis: I suspect the crash happens exactly when a state change event (such as onJoinChannelSuccess) is about to be triggered. I believe this is the case because the onJoinChannelSuccess callback is never received before the crash.
### Expected results
Stop application.
### Actual results
```log
Process 22359 stopped
* thread #60, name = 'AgoraEvent', stop reason = EXC_BAD_ACCESS (code=1, address=0x60)
frame #0: 0x00000002aabd2da4 libsystem_platform.dylib`_platform_strlen + 4
libsystem_platform.dylib`_platform_strlen:
-> 0x2aabd2da4 <+4>: ldr q0, [x1]
0x2aabd2da8 <+8>: adr x3, 0x2aabd2ce0 ; ___lldb_unnamed_symbol315
0x2aabd2dac <+12>: ldr q2, [x3], #0x10
0x2aabd2db0 <+16>: and x2, x0, #0xf
Target 0: (Runner) stopped.
Application finished.
```
### Code sample
Code sample
```dart
if (tokenInfo == null) {
logger.w('❌ Token info not initialized');
return false;
}
try {
if (_engine == null) {
logger.w('❌ Engine not initialized');
return false;
}
logger.d({
'Joining': {
'callId': sessionId,
'callType': callType,
'tokenInfo.channel': tokenInfo!.channel,
'tokenInfo.token': tokenInfo!.token,
'tokenInfo.uid': tokenInfo!.uid,
},
});
_currentCallType = callType;
_currentSessionId = sessionId; // Store callId for session tracking
_userType = userType;
_updateUserState(UserConnectionState.connecting);
// iOS 메모리 안정성: token 정보를 로컬 변수로 복사 및 공백 제거
final token = tokenInfo!.token.trim();
final channelId = tokenInfo!.channel.trim();
final uid = tokenInfo!.uid;
// 채널 입장
await _engine!.joinChannel(
token: token,
channelId: channelId,
uid: uid,
options: ChannelMediaOptions(
autoSubscribeAudio: true,
publishMicrophoneTrack: true,
autoSubscribeVideo: callType == ResCounselingSessionCounselingType.video,
publishCameraTrack: callType == ResCounselingSessionCounselingType.video,
// // Use clientRoleBroadcaster to act as a host or clientRoleAudience for audience
clientRoleType: ClientRoleType.clientRoleBroadcaster,
),
);
simpleLogger.d('✅ Joined channel: $channelId');
return true;
} catch (e, stackTrace) {
logger.e('❌ Join channel error', error: e, stackTrace: stackTrace);
_updateUserState(UserConnectionState.error);
errorNotifier.value = '채널 입장에 실패했습니다: $e';
return false;
}
```
### Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
### Logs
Logs
```console
[Paste your logs here]
```
### Flutter Doctor output
Doctor output
```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.5, on macOS 26.1 25B78 darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.2)
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
! Error: Browsing on the local area network for k1005 iPhone 13 pro max. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• No issues found!
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.