-
Notifications
You must be signed in to change notification settings - Fork 11
Error Handling and Troubleshooting
The purpose of this document is to list all of the errors, warnings that Agora UIKit may produce, and some common troubleshooting for this package.
Error Type | Description |
---|---|
AgoraVideoViewer.PermissionError | This error can occur when the user has not given permissions to devices such as the camera or microphone. Also check your Info.plist to make sure the relevant permissions have been added to your application's Info.plist |
AgoraVideoViewer.TokenError | This error occurs whenever there is an issue fetching a token from a provided tokenURL. A common reason for this could be that the token URL provided has a "/" at the end, the token server is down, or a different token server than expected is being used. |
AgoraRtmController.TokenError | Similar to AgoraVideoViewer.TokenError, this will also occur when there is an issue fetching a token from your provided token server URL. |
All other errors will be printed to the console in the format: [AgoraVideoViewer LOG_LEVEL]: Example Message")
The LOG_LEVEL value will be one of "ERROR", "WARNING", "DEBUG" or "INFO". By default, only "WARNING" and "ERROR" values will appear; this can be changed by setting the static property AgoraVideoViewer.printLevel
to an alternative enum value.
Here are some errors that you may see in Xcode's console:
Error Message | Description |
---|---|
[AgoraVideoViewer ERROR]: Could not enable video |
This can occur for a few reasons, including a bad appID being supplied. Check the Agora Console that your appId, and token (if needed) are correct. |
[AgoraVideoViewer ERROR]: Could not present popup |
If you don't provide a delegate for AgoraVideoViewer, or your delegate is not a UIViewController , the SDK cannot show popups such as ones used to request others mute/unmute devices. You will need to supply your own presentAlert method in this case.Check out AgoraVideoViewerDelegate.presentAlert to see more about this method. |
[AgoraVideoViewer ERROR]: Could not fetch token from server: ERROR_VAL |
This means the fetching of a token failed. The ERROR_VAL will be one of the AgoraVideoViewer.TokenError values mentioned above. |
Since version 1.8.0
Agora UIKit underwent a few changes, and is now made up of more than one library. Part of this means that you can now just use parts of Agora UIKit, including a wrapper for the RTM library from Agora; this wrapper is called AgoraRtcControl. this reduces your app size but also means there's an extra click when installing the library.
When importing the library from version 1.8.0 and above, use the new module name AgoraUIKit
as so:
import AgoraUIKit
When using a version earlier than 1.8.0, use import AgoraUIKit_iOS
.
Make sure both of these checkmarks are selected before proceeding to the next step when adding the import via Swift Package Manager.
![agora-uikit-dependencies](https://user-images.githubusercontent.com/5754073/162416294-8bdff204-f649-4414-bbd0-423e7c9cd661.png)
Alternatively, if you have already included the package and are still seeing an issue with missing imports: Head to your App's target, Build Phases, and add the two libraries (AgoraUIKit and AgoraRtmControl) to "Link Binary With Libraries".
![agora-uikit-link-libraries](https://user-images.githubusercontent.com/5754073/162416911-5cb1ebb6-8e9a-4b37-98d4-780c8568866e.png)
If your app is crashing, the most common issue when making a video calling application is that the privacy settings have not yet been added to your Info.plist. You may see a log in Xcode similar to this:
2022-04-08 13:50:15.936744+0200 Agora_UIKit-Example[11574:880873] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
For information on how to fix this, follow this guide from Apple.