Skip to main content

You are looking at Voice Calling v3.x Docs. The newest version is  Voice Calling 4.x

Android
iOS
macOS
Windows C++
Windows C#
Unity
Flutter
React Native
Electron
Cocos Creator
Cocos2d-x

Reduce the App Size

This page describes how to reduce the app size after integrating the Agora Video Calling Native SDK.

Use the Voice SDK

The Video SDK supports both audio and video functions, so the package size is larger. If you only need to use the audio functions, Agora recommends integrating the Voice SDK.

Remove unnecessary extension libraries

As of v3.3.0, the SDK provides extension libraries, which are dynamic libraries that can be optionally integrated into a project. Extension libraries are named with the extension suffix, and information on the functionality and size of extension libraries is provided in Extension libraries. If you do not need to use the functions provided by some extension libraries, you can reduce the size of the app by not integrating these extension libraries as described in the following sections.

Remove extension libraries during manual integration

When you integrate the SDK by using the SDK download link on the official website, you can directly remove the unnecessary extension library files.

Remove extension libraries when using CocoaPods

This method applies to iOS/macOS SDKs v3.6.2 and later.

When you integrate the iOS/macOS SDK with CocoaPods, you can reduce the size of your app after integrating the SDK by using the subspecs field in the Podfile to specify the desired dynamic libraries and exclude unnecessary extension libraries. See The subspecs fields for details on how dynamic libraries correspond to the subspecs fields.

Sample code

Example 1: When you integrate the iOS Video SDK v3.6.2 and use all extension libraries, the Podfile is as follows:


_4
# platform :ios, '9.0'
_4
target 'Your App' do
_4
pod 'AgoraRtcEngine_iOS', '3.6.2'
_4
end

Example 2: When you integrate the iOS Video SDK v3.6.2 without any extension libraries, the Podfile is as follows:


_4
# platform :ios, '9.0'
_4
target 'Your App' do
_4
pod 'AgoraRtcEngine_iOS', '3.6.2', :subspecs => ['RtcBasic']
_4
end

Example 3: When you integrate the iOS Video SDK v3.6.2 and use only the deep-learning noise reduction and super resolution extension libraries, the Podfile is as follows:


_4
# platform :ios, '9.0'
_4
target 'Your App' do
_4
pod 'AgoraRtcEngine_iOS', '3.6.2', :subspecs => ['RtcBasic', 'AINS', 'SuperResolution']
_4
end

When you fill in the pod command, make sure that the SDK with the specified version has the extension library that you specify and that the subspecs field of the extension library is correct; otherwise, an error is reported when you enter pod install. For example, if you fill in pod 'AgoraRtcEngine_iOS', '3.6.2', :subspecs => ['RtcBasic', 'AgoraRtcAINS'], an error is reported when you enter pod install.

Remove extension libraries when using Maven Central

This method applies to Android SDKs v3.6.2 and later.

When you integrate the Android SDK with Maven Central, you can reduce the size of your app after integrating the SDK by modifying the implementation field in dependencies in the /Gradle Scripts/build.gradle(Module: <projectname>.app) file to specify the desired dynamic libraries and exclude unnecessary extension libraries. See The implementation fields for details on how each file in the Android SDK corresponds to the implementation field.

Sample code

Example 1: When you integrate the Android Video SDK v3.6.2 and use all extension libraries, dependencies is as follows:


_4
dependencies {
_4
implementation 'io.agora.rtc:full-sdk:3.6.2'
_4
...
_4
}

Example 2: When you integrate the Android Video SDK v3.6.2 without any extension libraries, dependencies is as follows:


_4
dependencies {
_4
implementation 'io.agora.rtc:full-rtc-basic:3.6.2'
_4
...
_4
}

Example 3: When you integrate the Android Video SDK v3.6.2 and use only the deep-learning noise reduction and super resolution extension libraries, dependencies is as follows:


_8
dependencies {
_8
def agora_sdk_version = "3.6.2"
_8
// The following code contains $, so you must use "", not ''
_8
implementation "io.agora.rtc:full-rtc-basic:${agora_sdk_version}"
_8
implementation "io.agora.rtc:full-ains:${agora_sdk_version}"
_8
implementation "io.agora.rtc:full-super-resolution:${agora_sdk_version}"
_8
...
_8
}

Load .so files dynamically

  • This method applies to Android SDKs v3.6.2 and later.
  • This method applies to manual integration of the SDK only; it does not apply to integrations using Maven Central or JitPack.
  • Normally, you need to package required .so files when compiling the app, and the SDK loads .so files from the app's nativeLibraryPath.

    As of v3.6.2, the SDK provides the setAgoraLibPath method, which enables the app to dynamically load required .so files from its private directory when the app runs. This can reduce the app package size. Refer to the following steps to implement this function:

    1. Go to SDK Downloads, download the latest version of the Agora Voice or Video SDK, and extract the files from the downloaded SDK package.
    2. Integrate agora-rtc-sdk.jar into your project.
    3. Upload the .so files for all architectures to your server, and ensure your app can download the .so files for its target architecture over the network.
    4. The app checks if the .so files for its target architecture exist when running. If not, the app downloads the appropriate .so files over the network and saves them to the app's private directory.
    5. Call setAgoraLibPath, and set path as the app's private directory where the .so files are stored.
    6. When calling create to initialize an RtcEngine instance, the SDK automatically loads the .so files according to the specified path.

    Reference

    This section provides reference information for reducing the size of the app after integrating the SDK.

    Extension libraries

    The SDK provides extension libraries, which are dynamic libraries that can be optionally integrated into a project. Extension libraries are named with the extension suffix, and information on the functionality and size of extension libraries is provided in the following tables.

  • If you are using a version of the macOS SDK earlier than v3.6.2, extension libraries have the framework suffix, not xcframework as in the following tables. See v3.6.2 Release Notes.
  • Currently, the JND library, virtual background library, and super resolution library are only available on Android for the arm64-v8a and armeabi-v7a architectures; they are not available on Android for the x86 or x86_64 architectures.
  • Deep-learning noise reduction library

    The SDK enables traditional noise reduction by default to reduce most of the stationary background noise. Deep-learning noise reduction adds non-stationary background noise reduction based on the traditional noise reduction. After integrating the deep-learning noise reduction library, you can call enableDeepLearningDenoise to enable the deep-learning noise reduction. See v3.3.0 Release Notes.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_ai_denoise_extension.so1,120
    Androidarmeabi-v7alibagora_ai_denoise_extension.so792
    iOSarm64AgoraAIDenoiseExtension.xcframework502
    iOSarmv7AgoraAIDenoiseExtension.xcframework448
    macOSarm64AgoraAIDenoiseExtension.xcframework496
    macOSx86_64AgoraAIDenoiseExtension.xcframework588
    Windowsx86libagora_ai_denoise_extension.dll5,312
    Windowsx86_64libagora_ai_denoise_extension.dll5,424

    AV1 library (beta feature)

    The AV1 function improves the clarity of texts when users share the screen. To use this function, contact support@agora.io.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_dav1d_extension.so696
    Androidarmeabi-v7alibagora_dav1d_extension.so608
    iOSarm64AgoraDav1dExtension.xcframework959
    iOSarmv7AgoraDav1dExtension.xcframework746
    macOSx86_64AgoraDav1dExtension.xcframework1,316
    Windowsx86libagora_dav1d_extension.dll1,252
    Windowsx86_64libagora_dav1d_extension.dll1,756

    JND library (beta feature)

    As of v3.7.0, the JND library is statically compiled in the SDK by default and no longer provided as an extension library. If you have integrated the JND library, remove the JND extension library from your project dependencies and recompile your project when upgrading to v3.7.0.

    The JND (Just-noticeable difference) function is used for video perceptual coding, which reduces bandwidth consumption while keeping the same image quality. For example, this function can improve video smoothness in bandwidth-constrained scenarios and reduce network traffic consumption in mobile network scenarios. To use this function, contact support@agora.io.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_jnd_extension.so1,172
    Androidarmeabi-v7alibagora_jnd_extension.so816
    iOSarm64AgoraJNDExtension.xcframework78
    iOSarmv7AgoraJNDExtension.xcframework69
    macOSarm64AgoraJNDExtension.xcframework720
    macOSx86_64AgoraJNDExtension.xcframework616
    Windowsx86libagora_jnd_extension.dll1,528
    Windowsx86_64libagora_jnd_extension.dll1,948

    Virtual background library

    After integrating the virtual background library, you can call enableVirtualBackground to enable the virtual background. See v3.5.0 Release Notes.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_segmentation_extension.so3,331
    Androidarmeabi-v7alibagora_segmentation_extension.so2,232
    iOSarm64AgoraVideoSegmentationExtension.xcframework2,210
    iOSarmv7AgoraVideoSegmentationExtension.xcframework1,514
    macOSarm64AgoraVideoSegmentationExtension.xcframework2,802
    macOSx86_64AgoraVideoSegmentationExtension.xcframework2,449
    Windowsx86libagora_segmentation_extension.dll4,401
    Windowsx86_64libagora_segmentation_extension.dll5,193

    ROI library (beta feature)

    The ROI (Region of Interest) function is applied to the face or virtual background segmentation algorithm for face or portrait recognition. In the encoding process, higher quality encoding is used for the ROI to achieve a clearer face or portrait. To use this function, contact support@agora.io.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_fd_extension.so1,558
    Androidarmeabi-v7alibagora_fd_extension.so977
    iOSarmv7AgoraFDExtension.xcframework2,602
    iOSarm64AgoraFDExtension.xcframework3,534
    macOSx86_64AgoraFDExtension.xcframework1,674
    macOSarm64AgoraFDExtension.xcframework904
    Windowsx86_64libagora_fd_extension.dll1,993
    Windowsx86libagora_fd_extension.dll1,605

    Super resolution library (beta feature)

    After integrating the super resolution library, you can call enableRemoteSuperResolution to enable super resolution. See v3.5.1 and v3.7.1 Release Notes.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_super_resolution_extension.so837
    Androidarmeabi-v7alibagora_super_resolution_extension.so550
    iOSarm64AgoraSuperResolutionExtension.xcframework342
    iOSarmv7AgoraSuperResolutionExtension.xcframework340

    Video enhancement library

    As of v3.6.0, Agora provides a video enhancement library that provides the ability to apply basic image enhancement. As of v3.6.2, Agora also adds video noise reduction, low-light enhancement, and color enhancement features to the video enhancement library. See v3.6.0 and v3.6.2 Release Notes.

    You can call the following methods to enable the video enhancement features that you want after integrating the video enhancement library:

    • setBeautyEffectOptions: Sets basic image enhancement.
    • setVideoDenoiserOptions: Sets video noise reduction.
    • setLowlightEnhanceOptions: Sets low-light enhancement
    • setColorEnhanceOptions: Sets color enhancement.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_video_process_extension.so1,290
    Androidarmeabi-v7alibagora_video_process_extension.so962
    iOSarm64AgoraVideoProcessExtension.xcframework819
    iOSarmv7AgoraVideoProcessExtension.xcframework768
    macOSarm64AgoraVideoProcessExtension.xcframework1,785
    macOSx86_64AgoraVideoProcessExtension.xcframework895
    Windowsx86libagora_video_process_extension.dll2,171
    Windowsx86_64libagora_video_process_extension.dll2,541

    Full-format audio decoding library

    As of v3.6.2, the SDK provides the full-format audio decoding library, which optimizes the experience of calling startAudioMixing to play music files as follows:

    • Reduces issues of audio freezes or no audio when playing music files.
    • Increases the accuracy of the audio duration reported by getAudioFileInfo.
    • Supports more audio file formats.

    If you want to experience these improvements, ensure that you have integrated this dynamic library; if you do not need these improvements, you can remove this dynamic library when integrating the SDK, and the SDK automatically switches to the basic audio decoding library.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora-full-audio-format-extension.so4,436
    Androidarmeabi-v7alibagora-full-audio-format-extension.so4,088
    iOSarm64AgoraFullAudioFormatExtension.xcframework4,432
    iOSarmv7AgoraFullAudioFormatExtension.xcframework3,808
    macOSarm64AgoraFullAudioFormatExtension.xcframework4,720
    macOSx86_64AgoraFullAudioFormatExtension.xcframework4,720
    Windowsx86libagora-full-audio-format-extension.dll5,308
    Windowsx86_64libagora-full-audio-format-extension.dll7,736

    Spatial audio effect library

    As of v3.7.0, Agora provides the spatial audio effect library, which can add a sense of space to remote users' audio and simulate the audio transmission process in the real world. This enables the local user to hear remote users with the spatial audio effect. To use this function, contact support@agora.io.

    The following table shows the extension library name for each platform and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    Androidarm64-v8alibagora_spatial_audio_extension.so3,832
    Androidarmeabi-v7alibagora_spatial_audio_extension.so3,824
    iOSarm64AgoraSpatialAudioExtension.xcframework4,864
    iOSarmv7AgoraSpatialAudioExtension.xcframework4,352
    macOSarm64AgoraSpatialAudioExtension.xcframework4,880
    macOSx86_64AgoraSpatialAudioExtension.xcframework4,848
    Windowsx86libagora_spatial_audio_extension.dll5,096
    Windowsx86_64libagora_spatial_audio_extension.dll5,232

    ReplayKit library (iOS only)

    As of v3.7.0, the SDK provides the startScreenCapture method and the AgoraReplayKitExtension.xcframework extension library for screen sharing. See Share the Screen. The following table shows the extension library name and the increase in the app size after integration:

    PlatformArchitectureLibrary nameApp size increase after integration (KB)
    iOSarm64AgoraReplayKitExtension.xcframework96
    iOSarmv7AgoraReplayKitExtension.xcframework96

    The subspecs fields

    When you integrate the iOS/macOS SDK with CocoaPods, you can reduce the size of your app after integrating the SDK by using the subspecs field in the Podfile to specify the desired dynamic libraries and exclude unnecessary extension libraries. For details on how dynamic libraries correspond to the subspecs fields, see the following tables:

    iOS Video SDK

    Dynamic libraryCategoryThe subspecs field
  • AgoraRtcKit.xcframework
  • AgoraCore.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • Agoraffmpeg.xcframework
  • RequiredRtcBasic
    AgoraAIDenoiseExtension.xcframeworkOptionalAINS
    AgoraDav1dExtension.xcframeworkOptionalAV1Dec
    AgoraJNDExtension.xcframeworkOptionalJND (< 3.7.0 and ≥ 3.6.2)
    AgoraVideoSegmentationExtension.xcframeworkOptionalVirtualBackground
    AgoraFDExtension.xcframeworkOptionalROIEnc
    AgoraSuperResolutionExtension.xcframeworkOptionalSuperResolution
    AgoraVideoProcessExtension.xcframeworkOptionalVideoPreprocess
    AgoraFullAudioFormatExtension.xcframeworkOptionalFullAudioFormat
    AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio
    AgoraReplayKitExtension.xcframeworkOptionalReplayKit (≥ 3.7.0)

    iOS Voice SDK

    Dynamic libraryCategoryThe subspecs field
  • AgoraRtcKit.xcframework
  • AgoraCore.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • RequiredRtcBasic
    AgoraAIDenoiseExtension.xcframeworkOptionalAINS
    AgoraFullAudioFormatExtension.xcframeworkOptionalFullAudioFormat
    AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio

    macOS Video SDK

    Dynamic libraryCategoryThe subspecs field
  • AgoraRtcKit.xcframework
  • AgoraCore.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • Agoraffmpeg.xcframework
  • av1.framework
  • RequiredRtcBasic
    AgoraAIDenoiseExtension.xcframeworkOptionalAINS
    AgoraDav1dExtension.xcframeworkOptionalAV1Dec
    AgoraJNDExtension.xcframeworkOptionalJND (< 3.7.0 and ≥ 3.6.2)
    AgoraVideoSegmentationExtension.xcframeworkOptionalVirtualBackground
    AgoraFDExtension.xcframeworkOptionalROIEnc
    AgoraVideoProcessExtension.xcframeworkOptionalVideoPreprocess
    AgoraFullAudioFormatExtension.xcframeworkOptionalFullAudioFormat
    AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio

    macOS Voice SDK

    Dynamic libraryCategoryThe subspecs field
  • AgoraRtcKit.xcframework
  • AgoraCore.xcframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • RequiredRtcBasic
    AgoraAIDenoiseExtension.xcframeworkOptionalAINS
    AgoraFullAudioFormatExtension.xcframeworkOptionalFullAudioFormat
    AgoraSpatialAudioExtension.xcframeworkOptionalSpatialAudio

    The implementation fields

    When you integrate the Android SDK with Maven Central, you can reduce the size of your app after integrating the SDK by modifying the implementation field in dependencies in the /Gradle Scripts/build.gradle(Module: <projectname>.app) file to specify the desired dynamic libraries and exclude unnecessary extension libraries. For details on how each file in the Android SDK corresponds to the implementation field, see the following tables:

    Android Video SDK

    FileCategoryThe implementation field
  • agora-rtc-sdk.jar
  • Header files under the include folder
  • libagora-rtc-sdk.so
  • libagora_fdkaac.so
  • libagora_mpg123.so
  • libagora-core.so
  • libagora-soundtouch.so
  • libagora-ffmpeg.so
  • Requiredio.agora.rtc:full-rtc-basic
    libagora_ai_denoise_extension.soOptional
  • io.agora.rtc:full-ains (v3.6.2)
  • io.agora.rtc::ains (as of v3.7.0)
  • libagora_dav1d_extension.soOptionalio.agora.rtc:full-av1-dec
    libagora_jnd_extension.soOptionalio.agora.rtc:full-jnd (< 3.7.0 and ≥ 3.6.2)
    libagora_segmentation_extension.soOptionalio.agora.rtc:full-virtual-background
    libagora_fd_extension.soOptionalio.agora.rtc:full-roi-enc
    libagora_super_resolution_extension.soOptionalio.agora.rtc:full-super-resolution
    libagora_video_process_extension.soOptionalio.agora.rtc:full-video-preprocess
    libagora_full_audio_format_extension.soOptional
  • io.agora.rtc:full-full-audio-format (v3.6.2)
  • io.agora.rtc:full-audio-format (as of v3.7.0)
  • libagora_spatial_audio_extension.soOptionalio.agora.rtc:spatial-audio

    Android Voice SDK

    FileCategoryThe implementation field
  • agora-rtc-sdk.jar
  • Header files under the include folder
  • libagora-rtc-sdk.so
  • libagora_fdkaac.so
  • libagora_mpg123.so
  • libagora-core.so
  • libagora-soundtouch.so
  • Requiredio.agora.rtc:voice-rtc-basic
    libagora_ai_denoise_extension.soOptional
  • io.agora.rtc:voice-ains (v3.6.2)
  • io.agora.rtc::ains (as of v3.7.0)
  • libagora_full_audio_format_extension.soOptional
  • io.agora.rtc:voice-full-audio-format (v3.6.2)
  • io.agora.rtc:full-audio-format (as of v3.7.0)
  • libagora_spatial_audio_extension.soOptionalio.agora.rtc:spatial-audio

    Voice Calling