Mounting pak files(successful) but android load uasset fail

Hi guys, I try to mount pak file at running time and then load the static mesh use, it works on both editor and standalone version of window.

However it will not work on android( I did package the pak file using android cooked assets)

this is the code:

bool ATangoObjectVisGameModeBase::StartStreaming()
{

	if (PakPlatform.IsValid())
	{
		if (PakPlatform->Initialize(PlatformFile, TEXT("")))
		{
			FPlatformFileManager::Get().SetPlatformFile(*PakPlatform);

			const FString PakFileRemotePath = AndroidDir; //FString(TEXT("D:/OutpakEditor.pak"));
			FPakFile PakFile(PlatformFile, *PakFileRemotePath, false);

			if (PakFile.IsValid())
			{
				// We have to mount the file into the engine content dir, if not you will not be able to load it async!
				PakFile.SetMountPoint(*FPaths::EngineContentDir());
				if (PakPlatform->Mount(*PakFileRemotePath, 0, *FPaths::EngineContentDir())) // This is the byte order
				{
					GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Red, FString::Printf(TEXT("EngineContentDir '%s'"), *FPaths::EngineContentDir()));
					// The assets we will stream from the Pak file
					TSet<FString> PakContent;
					PakFile.FindFilesAtPath(PakContent, *PakFile.GetMountPoint(), true, false, true);

					int tempCount = 0;
					for (TSet<FString>::TConstIterator SetIt(PakContent); SetIt; ++SetIt)
					{
						FString AssetName = *SetIt;
						// You might load other such as .umaps too I guess :D
						if (AssetName.EndsWith(FPackageName::GetAssetPackageExtension()))
						{
							// This is where we change the path to be an engine path (as stated earlier)
							FString AssetShortName = FPackageName::GetShortName(AssetName);
							AssetShortName.RemoveFromEnd(FPackageName::GetAssetPackageExtension());
							AssetName = TEXT("/Engine/") + AssetShortName + TEXT(".") + AssetShortName;
							TargetAssets.Add(AssetName);
							//take assetname check if texture,model, and apply accordingly
							GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Red, FString::Printf(TEXT("AssetName %d : '%s'"), tempCount,*AssetName));
							tempCount++;
						}
					}

					FStreamableManager& Streamable = USolusDataSingleton::Get().Streamable;
					//Streamable.RequestAsyncLoad(TargetAssets, FStreamableDelegate::CreateUObject(this, &ATangoObjectVisGameModeBase::OnStreamingCompleteDelegate));
					//FPaths::EngineContentDir() + "Arrow.uasset"

					Object = Cast<UStaticMesh>(StaticLoadObject(UStaticMesh::StaticClass(), NULL, *TargetAssets[0].ToString()));
					if (Object != nullptr)
					{
						GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Red, TEXT("object 22"));
					}

					Object = Cast<UStaticMesh>(Streamable.SynchronousLoad(TargetAssets[0]));
					if (Object != nullptr)
					{
						GEngine->AddOnScreenDebugMessage(-1, 50.f, FColor::Red, TEXT("object 1"));
					}

				}
			}
		}
	}
	return false;
}

this is the output:

2017.02.12-15.34.00 [Project Tango Tablet Development Kit-15207] 00008.002: LogProfilerService: Subscribe Session: 7670430749ED18BCC19075B7CAA808B1, Instance: 0000433E34020F0C002102520EE1EEFA
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.715: LogTemp: open/create the file Success
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.720: LogBlueprintUserMessages: [ARGameMode_C_0] Success
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.721: LogModuleManager: ModuleManager: Module 'HTTPChunkInstaller' not found - its StaticallyLinkedModuleInitializers function is null.
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.726: LogModuleManager: ModuleManager: Module 'HTTPChunkInstaller' not found - its StaticallyLinkedModuleInitializers function is null.
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.730: LogModuleManager: ModuleManager: Module 'HTTPChunkInstaller' not found - its StaticallyLinkedModuleInitializers function is null.
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.744: LogLinker: Can't find file '/Engine/Content/Arrow'
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.745: LogUObjectGlobals: Failed to load '/Engine/Content/Arrow': Can't find file '/Engine/Content/Arrow'
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.748: LogLinker: Can't find file '/Engine/Content/Arrow'
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.748: LogUObjectGlobals: Failed to load '/Engine/Content/Arrow': Can't find file '/Engine/Content/Arrow'
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.750: LogUObjectGlobals: Failed to find object 'Object /Engine/Content/Arrow.Arrow'
2017.02.12-15.34.05 [Project Tango Tablet Development Kit-15207] 00013.751: LogStreamableManager: Failed attempt to load /Engine/Content/Arrow.Arrow

I also did try using this:
FCoreDelegates::OnMountPak.Execute(*AndroidDir, 0, nullptr)
but nth work : /

not sure why unreal can’t find the file : / on android… please help guys

That log says your http chunk downloader isn’t being compiled for Android. If that’s how you are getting your file, that’s why you can’t find it

Thanks you very much for the tips,

Do you have any idea why http chunk downloader is not available ?
I did in include http module in the build file.

Check that it isn’t marked as not being for that platform. Also, there may be an Android specific one that needs to be used instead.

why not use 4.14.3’s mobile pak patching system?

I found that the error httpChunkInstall missing module come from this line:

if (PakPlatform->Initialize(PlatformFile, TEXT("")))

bool FPakPlatformFile::Initialize(IPlatformFile* Inner, const TCHAR* CmdLine)
{

    	// Inner is required.
    	check(Inner != NULL);
    	LowerLevel = Inner;
    
    #if EXCLUDE_NONPAK_UE_EXTENSIONS
    	// Extensions for file types that should only ever be in a pak file. Used to stop unnecessary access to the lower level platform file
    	ExcludedNonPakExtensions.Add(TEXT("uasset"));
    	ExcludedNonPakExtensions.Add(TEXT("umap"));
    	ExcludedNonPakExtensions.Add(TEXT("ubulk"));
    	ExcludedNonPakExtensions.Add(TEXT("uexp"));
    #endif
    
    #if !USING_SIGNED_CONTENT
    	bSigned = FParse::Param(CmdLine, TEXT("Signedpak")) || FParse::Param(CmdLine, TEXT("Signed"));
    	if (!bSigned)
    	{
    		// Even if -signed is not provided in the command line, use signed reader if the hardcoded key is non-zero.
    		FEncryptionKey DecryptionKey;
    		DecryptionKey.Exponent.Parse(DECRYPTION_KEY_EXPONENT);
    		DecryptionKey.Modulus.Parse(DECRYPTION_KEY_MODULUS);
    		bSigned = !DecryptionKey.Exponent.IsZero() && !DecryptionKey.Modulus.IsZero();
    	}
    #else
    	bSigned = true;
    #endif
    	
    	bool bMountPaks = true;
    	TArray<FString> PaksToLoad;
    #if !UE_BUILD_SHIPPING
    	// Optionally get a list of pak filenames to load, only these paks will be mounted
    	FString CmdLinePaksToLoad;
    	if (FParse::Value(CmdLine, TEXT("-paklist="), CmdLinePaksToLoad))
    	{
    		CmdLinePaksToLoad.ParseIntoArray(PaksToLoad, TEXT("+"), true);
    	}


return !!LowerLevel;
}

not sure why it would give error on android?

Hi, I can’t find any documentation related to that topic not sure where to start.

Please could you help me… like briefly describe what it is? Thanks

I successfully download and mount the pak file via patching system, but can’t seem to find the asset.

I try look up the Install Directory, not sure how to follow the path?
my Install directory is “myGameAsset”

and my.uasset is at the root folder of the content dir when packaging

=> is the full path ? “myGameAsset/my.uasse”

what u put inside of mainfest and install dir?
post pic of your inputs.

Hi , here is the screenshot! , the installation return without an error, the problem is that I’m not sure about the path of the object that was loaded.

try “/Game/myGameAsset/”

so u should found your files under " /Game/myGameAsset/my.uasse"

I mounted the content to /Game/ folder… but it’s nowhere to be found

: / please help

You are going to need to debug the code and see why it is failing

are u putting cooked assets for android inside the pak and then trying to load the pak from windows?

I think I know what the problem is : /… the asset that I’m try to load is not part of the original map. It’s new content added to game => the engine can’t find reference to it? (my guess)

When you mount a pack file, there’s a parameter to read all the files in it. Do that and log it out to verify everything is as expected. See the online hotfix manager for sample code to do just that

Yeah I’ve done that,

even call FPaths::FileExists and it returns “true”.

still when i do static load object, it says can’t find file : /

try that and see if that works for you or not. if that also fails then you are doing something wrong.

Yeah my code is based on that plugins, the only difference is that I manually using HTTP to download the Pak file and store it on Android local storage. Instead of using NetPlatForm file , which I don’t know how to host such server : /

if you’re calling static load object it needs to be in proper full object path form:

Game/Dir/object.object_c for a blueprint. Plenty of examples in the engine on what those strings look like