How to dynamic add Assets in Paks?Use FStreamableManager::RequestAsyncLoad

When I use FStreamableManager::RequestAsyncLoad to load objs in pak, it returned warnings . And Loading-Objs is failed!


[2017.07.17-13.30.42:665] 67]LogLinker:Warning: The file '../../../mankuH/Content/DOT.uasset' contains unrecognizable data, check that it is of the expected type.
[2017.07.17-13.30.42:665] 67]LogLinker:Warning: The file '../../../mankuH/Content/boxMesh.uasset' contains unrecognizable data, check that it is of the expected type.
[2017.07.17-13.30.42:665] 67]LogLinker:Warning: The file '../../../mankuH/Content/texture/hx3.uasset' contains unrecognizable data, check that it is of the expected type.

[2017.07.17-13.30.42:681] 68]AsyncLoadComplete()!!!

The code is here:



	FString objPath = "/Game/DOT.DOT";
	FString objPath2 = "StaticMesh'/Game/boxMesh.boxMesh'";
	res.arryObjPaths.Add(objPath);
	res.arryObjPaths.Add(objPath2);
        ....
	FStringAssetReference reference ( objsArry[0]);
	FStringAssetReference reference2 (objsArry[1]);
	FStringAssetReference reference3 (TEXT("/Game/texture/hx3.hx3"));
	StreamableAssetLoader.RequestAsyncLoad(resourcesOnLoad[ID_ON_LOAD]->ItemsToStream, FStreamableDelegate::CreateUObject(this, &UResourcesController::AsyncLoadComplete));


I found this error in UE4 wiki,many developer got this error , but there is no solution .
I used UObjectLibrary to get the asset reference , but UObjectLibrary seems can’t work for Paks’ assets.
I used


Async<void>(EAsyncExecution::ThreadPool, =]() { return LoadObjectsFromArry(resourcesOnLoad[ID_ON_LOAD]->arryObjPaths); }, =]() { return AsyncLoadComplete(); });

but LoadObject<UObject> will be broken in Async-Thread, so I’m confused now ,How to Dynamic load pak assets???

No one is good at this interface?

I don’t think many people have used the AssetManager since it’s relatively new.

You may want to read the overview here(see the PDF attached to the bug report) and see if it helps you.

hi,thank you for you reply.
I used asset manager to load objs in a Pak, but I didn’t get any object in /Game/ path from the pak.

now someone told me that the pak packaged with UnrealPak.exe would make an error . The error let the pak become useless in the filesystem.
But I don’t know how to pak the resoures for third-party using.
Once I used the command line to pak is this:

%UnrealPakExePath% %OutputPakFile% -create=%SourceFileList% -order=CookerOpenOrder.log

besides , the assets in the pak always get uv image error , and this is someone else get the same prolem
https://answers.unrealengine.com/questions/513505/load-pak-in-game-win64texture-is-show-error-in-mat.html