I’m working on a making plugin with third party library.
The library requires a license file’s absolute path using original file extension (like .xy but it’s just xml format file)
MyUEProject/
┗ Plugins/
┗ ThirdPartyPlugin/
┗ Assets/
┗ license.xy
I added ../Plugins/ThirdPartyPlugin/Assets
to
Project> Packaging> [Additional Non-Assets Directories to Package]
On iOS, This codes in plugin works fine:
FString FullPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*FPaths::ProjectPluginsDir());
FString filePath = FullPath + FString("ThirdPartyPlugin/Assets/license.xy");
However, on Android, the filePath
won’t be absolute path. This will be "../../../MyUEProject/Plugins/"
I googled and tried codes below:
extern FString GFilePathBase;
FString androidFullPath = GFilePathBase + FString("/UE4Game/") + FApp::GetGameName() + "/" + FApp::GetGameName() +FString("/ThirdPartyPlugin/Assets/license.xy");
androidFullPath
will be:
/storage/emulated/0/UE4Game/MyUEProject/MyUEProject/Plugins/ThirdPartyPlugin/Assets/license.xy
But licence.xy
file isn’t there.
How to add non-asset files for a custom plugin?
And how to get absolute path of plugin’s non-asset files on Android?