【SoundNet SDK】When compiling the SDK integrated with SoundNet RTC and RTM, an error Redefinition of enumerator is reported

wrong description

When integrating RTC and RTM at the same time, an error will be reported during compilation. The reason for the error is "Redefinition of enumerator", which should be a repetition of the enumeration type. The screenshot is as follows:

Related search keywords are as follows:
Redefinition of enumerator 'AgoraAreaCodeCN'
Redefinition of enumerator 'AgoraAreaCodeNA'
Redefinition of enumerator 'AgoraAreaCodeEU'

solution

There is already a solution to this problem on the official website, but the documentation is not very detailed, making developers confused;
https://docs.agora.io/cn/Real-time-Messaging/rtm_integration_bp?platform=iOS #agorartmareacode - Naming conflicts arising from enumerations

The detailed supplementary plan is as follows:
1. Comment out the AgoraRtmKit.h header file and use the AgoraRtmKit_swift.h header file instead

//#import <AgoraRtmKit/AgoraRtmKit.h>
#import <AgoraRtmKit/AgoraRtmKit_swift.h>

2. Regardless of whether you are pod-integrated or manually integrated, right-click AgoraRtmKit.framework Show in Finder, delete the AgoraRtmKit.h header file, and re-clean build.

Guess you like

Origin blog.csdn.net/u014220518/article/details/124946675