Unreal ffmpeg library's libavcodec.so cannot be packaged into APK

I currently use Unreal 4.23.1 to develop Android system programs. I currently use the ffmpeg library to dynamically convert the sampling rate of sound. I add the relevant SO libraries to my Build.cs code. I use UE to package the Android APK program. There is no problem with packaging, but the SO file cannot be packaged into the APK file, which causes the Android system to crash as soon as I run it. Has anyone encountered such a problem?

Below is the code in my build.cs file

using UnrealBuildTool;
using System.IO;
using System;

public class MIC : ModuleRules
{
public MIC(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

    PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "AudioCapture", "AudioMixer", "WebSockets", "Json", "JsonUtilities", "MediaAssets", "Voice","OnlineSubsystem"});
    
    string ThirdPartyPath = Path.Combine(ModuleDirectory, "../../ThirdParty/ffmpeg");
    string LibrariesPath = Path.Combine(ThirdPartyPath, "lib");
    string BinariesPath = Path.Combine(ModuleDirectory, "../../Binaries/Win64");

    PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "include"));

    // 根据目标平台加载相应的库文件
    if (Target.Platform == UnrealTargetPlatform.Win64)
    {
        // Windows 使用的库和 DLL 文件
        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "avcodec.lib"));
        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "avformat.lib"));
        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "avutil.lib"));
        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "swresample.lib"));
        PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "swscale.lib"));

        PublicDelayLoadDLLs.Add("avcodec-58.dll");
        PublicDelayLoadDLLs.Add("avformat-58.dll");
        PublicDelayLoadDLLs.Add("avutil-56.dll");
        PublicDelayLoadDLLs.Add("swresample-3.dll");
        PublicDelayLoadDLLs.Add("swscale-5.dll");

        if (!Directory.Exists(BinariesPath))
        {
            Directory.CreateDirectory(BinariesPath);
        }

        string[] DllNames = { "avcodec-58.dll", "avformat-58.dll", "avutil-56.dll", "swresample-3.dll", "swscale-5.dll" };
        foreach (string DllName in DllNames)
        {
            string SourcePath = Path.Combine(LibrariesPath, DllName);
            string DestinationPath = Path.Combine(BinariesPath, DllName);

            if (File.Exists(SourcePath))
            {
                File.Copy(SourcePath, DestinationPath, true);
            }
        }

        foreach (string DllName in DllNames)
        {
            RuntimeDependencies.Add(Path.Combine(BinariesPath, DllName));
        }
    }
    else if (Target.Platform == UnrealTargetPlatform.Android)
    {
        // Android 使用的 SO 文件
        string AndroidLibrariesPath = Path.Combine(LibrariesPath, "android", "armeabi-v7a");
        PublicAdditionalLibraries.Add(Path.Combine(AndroidLibrariesPath, "libavcodec.so"));
        PublicAdditionalLibraries.Add(Path.Combine(AndroidLibrariesPath, "libavformat.so"));
        PublicAdditionalLibraries.Add(Path.Combine(AndroidLibrariesPath, "libavutil.so"));
        PublicAdditionalLibraries.Add(Path.Combine(AndroidLibrariesPath, "libswresample.so"));
        PublicAdditionalLibraries.Add(Path.Combine(AndroidLibrariesPath, "libswscale.so"));

        // 添加此行来确保 libavcodec.so 作为运行时依赖被添加
        string PluginLibPath = Path.Combine(AndroidLibrariesPath, "libavcodec.so");
        RuntimeDependencies.Add("$(TargetOutputDir)/libavcodec.so", PluginLibPath, StagedFileType.NonUFS);

        // 添加运行时依赖
        RuntimeDependencies.Add("$(TargetOutputDir)/libavcodec.so", Path.Combine(AndroidLibrariesPath, "libavcodec.so"), StagedFileType.NonUFS);
        RuntimeDependencies.Add("$(TargetOutputDir)/libavformat.so", Path.Combine(AndroidLibrariesPath, "libavformat.so"), StagedFileType.NonUFS);
        RuntimeDependencies.Add("$(TargetOutputDir)/libavutil.so", Path.Combine(AndroidLibrariesPath, "libavutil.so"), StagedFileType.NonUFS);
        RuntimeDependencies.Add("$(TargetOutputDir)/libswresample.so", Path.Combine(AndroidLibrariesPath, "libswresample.so"), StagedFileType.NonUFS);
        RuntimeDependencies.Add("$(TargetOutputDir)/libswscale.so", Path.Combine(AndroidLibrariesPath, "libswscale.so"), StagedFileType.NonUFS);

        // 这里修改为动态加载 OnlineSubsystemGooglePlay
        DynamicallyLoadedModuleNames.Add("OnlineSubsystemGooglePlay");
        // 可能还需要保留对其他模块的私有依赖
        PrivateDependencyModuleNames.Add("OnlineSubsystem");
        //PrivateDependencyModuleNames.Add("AndroidAdvertising");
    }

}

}

This problem has been solved. I created an APL XML file to package the SO file into the APK when packaging.