How do I handle issues when integrating the Signaling SDK and Video/Voice SDK simultaneously?
Updated
When integrating Signaling SDK version 2.2.0 and above with Video/Voice SDK version 4.5.0 or higher, the following errors may appear in the IDE:
com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'lib/x86/libaosl.so'Unexpected duplicate tasks
Multiple commands produce <your_app_build_path>/Contents/Frameworks/aosl.framework/Versions/A'
The 'XXX' target has frameworks with conflicting names: aosl.xcframework.Why this happens
Both Signaling SDK versions 2.2.0 and above and Video/Voice SDK versions 4.5.0 and above use the same library:
- Android:
libaosl.so - iOS/macOS:
aosl.xcframework - Windows:
libaosl.dll
As a result, the IDE detects multiple files with the same path during the build process, leading to errors.
Solution
Follow these steps to resolve the issue:
Signaling version 2.2.8 or later
For Signaling SDK version 2.2.8 or later, compare the versions of the aosl libraries used in the Video/Voice SDK and Signaling SDK. Choose the subsequent operations based on the two.
You can find the aosl library version for the SDKs in the Video SDK or Voice SDK release notes and Signaling release notes.
-
If the Signaling
aoslversion is lower, integrate theliteSDK:dependencies { // If you are using RTM SDK version 2.2.8 or later // Replace x.y.z with the specific SDK version number, such as 2.2.8 // You can obtain the latest version number from the release notes. implementation 'io.agora.rtm:rtm-sdk-lite:2.2.8' } -
If the Signaling
aoslversion is higher, integrate the latestaoslcomponent and usepickFirstto ensure the higher-versionaosllibrary is prioritized during the build process.
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst 'lib/**/libaosl.so' } } dependencies { implementation 'io.agora.infra:aosl:x.y.z' // implementation RTM sdk // implementation RTC sdk }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += ["lib/**/libaosl.so"] } } } dependencies { implementation 'io.agora.infra:aosl:x.y.z' // implementation RTM sdk // implementation RTC sdk }
-
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst("lib/**/libaosl.so") } } dependencies { implementation("io.agora.infra:aosl:x.y.z") // implementation RTM sdk // implementation RTC sdk }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += setOf("lib/**/libaosl.so") } } } dependencies { implementation("io.agora.infra:aosl:x.y.z") // implementation RTM sdk // implementation RTC sdk }
-
-
If the Signaling
aoslversion is lower, integrate theliteSDK:platform :ios, '11.0' target 'Your App' do # If you are using RTM SDK version 2.2.8 or later # Replace x.y.z with the specific SDK version number, such as 2.2.8 # You can obtain the latest version number from the release notes. pod 'AgoraRtm', 'x.y.z', :subspecs => ['RtmKit'] end -
If the Signaling
aoslversion is higher, add the following script to yourPodfile:
The following code uses the Video SDK with the package name AgoraRtcEngine_iOS as an example. Use the actual platform and version for your integration.
pre_install do |installer|
# Define the path to the RTC framework
rtc_pod_path = File.join(installer.sandbox.root, 'AgoraRtcEngine_iOS')
# Full path to aosl.xcframework
aosl_xcframework_path = File.join(rtc_pod_path, 'aosl.xcframework')
# Check if the file exists, and delete it if so
if File.exist?(aosl_xcframework_path)
puts "Deleting aosl.xcframework from #{aosl_xcframework_path}"
FileUtils.rm_rf(aosl_xcframework_path)
else
puts "aosl.xcframework not found, skipping deletion."
end
endSignaling version 2.2.2 to 2.2.6
For Signaling SDK versions between 2.2.2 and 2.2.6, compare the versions of the aosl libraries used in the Video/Voice SDK and Signaling SDK, then delete the library file with the lower version.
You can find the aosl library version for the SDKs in the Video SDK or Voice SDK release notes and Signaling release notes.
If the version of the aosl library included in the Video/Voice SDK package is lower, delete the outdated library file based on the target platform:
- Android: Delete the older-version
libaosl.sofile from the SDK package. - iOS/macOS: Delete the older-version
aosl.xcframeworkfile from the SDK package. - Windows: Delete the older-version
libaosl.dllfile from the SDK package.
If the version of the aosl library in the Signaling SDK package is lower, integrate the lite SDK, then clean and rebuild your project to resolve the library conflict.
// ...
dependencies {
// If you are using RTM SDK version 2.2.2 to 2.2.6
// Replace x.y.z with the specific SDK version number, such as 2.2.2
// You can obtain the latest version number from the release notes.
implementation 'io.agora:agora-rtm-lite:x.y.z'
}platform :ios, '11.0'
target 'Your App' do
# If you are using RTM SDK version 2.2.2 to 2.2.6
# Replace x.y.z with the specific SDK version number, such as 2.2.2
# You can obtain the latest version number from the release notes.
pod 'AgoraRtm', 'x.y.z', :subspecs => ['RtmKit']
endSignaling versions prior to 2.2.2
If you are using a Signaling SDK version prior to 2.2.2, refer to the following solutions based on your platform.
-
Using CDN
- Manually delete the following files from the SDK package:
lib/x86/libaosl.solib/x86_64/libaosl.solib/armeabi-v7a/libaosl.solib/arm64-v8a/libaosl.so
- Rebuild the project
-
Using Maven
- Add a
packagingOptionsblock to theandroidblock of yourbuild.gradlefile to ensure the first matching native library is prioritized during the build process:
- Add a
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst 'lib/x86/libaosl.so' pickFirst 'lib/x86_64/libaosl.so' pickFirst 'lib/armeabi-v7a/libaosl.so' pickFirst 'lib/arm64-v8a/libaosl.so' } }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += [ "lib/x86/libaosl.so", "lib/x86_64/libaosl.so", "lib/armeabi-v7a/libaosl.so", "lib/arm64-v8a/libaosl.so" ] } } }
-
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst("lib/x86/libaosl.so") pickFirst("lib/x86_64/libaosl.so") pickFirst("lib/armeabi-v7a/libaosl.so") pickFirst("lib/arm64-v8a/libaosl.so") } }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += setOf( "lib/x86/libaosl.so", "lib/x86_64/libaosl.so", "lib/armeabi-v7a/libaosl.so", "lib/arm64-v8a/libaosl.so" ) } } }
-
- After the Gradle files are synchronized, rebuild the project.
-
Using CDN
-
Manually delete the
libs/aosl.xcframeworkfile from the SDK package. -
Rebuild the project.
-
-
Using Cocoapods
-
Add the following script to the end of your project
podfile:pre_install do |installer| # Define the path to the AgoraRtm framework rtm_pod_path = File.join(installer.sandbox.root, 'AgoraRtm') # The full path to `aosl.xcframework` aosl_xcframework_path = File.join(rtm_pod_path, 'aosl.xcframework') # Check if the file exists; delete it if it does. if File.exist?(aosl_xcframework_path) puts "Deleting aosl.xcframework from #{aosl_xcframework_path}" FileUtils.rm_rf(aosl_xcframework_path) else puts "aosl.xcframework not found, skipping deletion." end end -
Run
pod installto re-integrate the Signaling and Video/Voice SDK. -
Rebuild the project.
-
Select the solution based on your target platform:
-
Android
-
Add the dependency to the
build.gradlefile in the project root directory:dependencies { api 'io.agora.infra:aosl:1.2.13' // ... } -
When integrating through Maven, add a
packagingOptionsblock to theandroidblock of yourbuild.gradlefile to ensure the first matching native library is prioritized during the build process:
-
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst 'lib/x86/libaosl.so' pickFirst 'lib/x86_64/libaosl.so' pickFirst 'lib/armeabi-v7a/libaosl.so' pickFirst 'lib/arm64-v8a/libaosl.so' } }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += [ "lib/x86/libaosl.so", "lib/x86_64/libaosl.so", "lib/armeabi-v7a/libaosl.so", "lib/arm64-v8a/libaosl.so" ] } } }
-
-
Android Gradle Plugin < 7.x
android { packagingOptions { pickFirst("lib/x86/libaosl.so") pickFirst("lib/x86_64/libaosl.so") pickFirst("lib/armeabi-v7a/libaosl.so") pickFirst("lib/arm64-v8a/libaosl.so") } }-
Android Gradle Plugin 7.x or later (Recommended)
android { packaging { jniLibs { pickFirsts += setOf( "lib/x86/libaosl.so", "lib/x86_64/libaosl.so", "lib/armeabi-v7a/libaosl.so", "lib/arm64-v8a/libaosl.so" ) } } }
-
- After the Gradle files are synchronized, rebuild the project.
-
iOS
-
When integrating via CocoaPods, add the following script to the end of your project's
Podfile:pre_install do |installer| # Define the path to the AgoraRtm framework rtm_pod_path = File.join(installer.sandbox.root, 'AgoraRtm') # The full path to `aosl.xcframework` aosl_xcframework_path = File.join(rtm_pod_path, 'aosl.xcframework') # Check if the file exists; delete it if it does. if File.exist?(aosl_xcframework_path) puts "Deleting aosl.xcframework from #{aosl_xcframework_path}" FileUtils.rm_rf(aosl_xcframework_path) else puts "aosl.xcframework not found, skipping deletion." end end -
Run
pod installto re-integrate the Signaling and Video/Voice SDK. -
Rebuild the project.
-
