Lists known issues and workarounds for the ApsaraVideo Real-time Communication (ARTC) SDK beta on HarmonyOS NEXT. Review this topic before integration. If you have questions,submit a ticket for support.
ArkTS issues
-
Crash caused by using a map to create an object
// SDK interface public playAudioEffect(soundId: number, filePath: string, config: AliRtcAudioEffectConfig): numbe // Use a map to create an object in ArkTS. // The map cannot be directly matched to the expected C++ object, which may cause a crash. this.rtcSdk?.playAudioEffect(1, "test", { needPublish: true, loopCycles: 0, startPosMs: 0, publishVolume: 0, playoutVolume: 0 } ); // Recommended method let config = new AliRtcAudioEffectConfig(); config.needPublish = 0; config.loopCycles = 0; config.startPosMs = 0; config.publishVolume = 0; config.playoutVolume = 0; this.rtcSdk?.playAudioEffect(1, "test", config); -
Invalid data type
Pass the correct data type defined by the SDK. For example, the loopCycles parameter in AliRtcAudioEffectConfig must be a number. Passing a string can cause a conversion error and disrupt business logic.
Audio issues
-
No speaker-earpiece switching during calls
HarmonyOS NEXT does not provide an API to switch between the speaker and earpiece.
-
Occasional audio playback failures after repeatedly joining and leaving calls
A HarmonyOS NEXT issue. Restart the phone to resolve it.
-
Using a Type-C to 3.5 mm adapter with three-ring headphones causes audio disorder in meetings.
A HarmonyOS NEXT issue. Restart the phone to resolve it. Avoid using Type-C to 3.5 mm adapters with headphones.
Video issues
Preview screen flickers when the app returns to the foreground
HarmonyOS NEXT restricts camera usage for background apps. The camera restarts when the app returns to the foreground, causing the preview to flicker.
Performance issues
-
Occasional ANR errors when engines are repeatedly created and destroyed
The upper layer of HarmonyOS NEXT uses single-threaded TypeScript (TS) engines. Calling native APIs within callback methods can trigger ANR errors. This issue is being resolved with Huawei. Avoid calling RTC APIs within callbacks and implement platform-layer protection for quick transitions.
-
Event callbacks are less timely than on Android and iOS
Native callbacks to the platform layer are routed through the main thread and execute sequentially, causing delays. This issue is being addressed with Huawei. Reduce registered listeners and implement callbacks only when necessary.
Data callback issues
Raw data callbacks for recorded video and audio are unavailable
Callbacks to the platform layer are routed through the main thread. Processing recorded video and audio data on the main thread can cause thread blocking and ANR errors, so these APIs are not currently provided.