x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.14
Tags:
more ▼

asked Feb 13 '17 at 11:42 PM in C++ Programming

avatar image

panha
23 6 13 9

avatar image Muzaheed Feb 20 '17 at 04:36 PM

why not use 4.14.3's mobile pak patching system?

avatar image panha Feb 20 '17 at 08:05 PM

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

avatar image panha Feb 20 '17 at 10:13 PM

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

alt text

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"

capture.png (53.2 kB)
avatar image Muzaheed Feb 21 '17 at 10:17 AM

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

avatar image panha Feb 21 '17 at 10:29 AM

alt text

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.

capture.png (216.8 kB)
avatar image Muzaheed Feb 21 '17 at 12:59 PM

try "/Game/myGameAsset/"

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

avatar image panha Feb 21 '17 at 03:17 PM

alt text

I mounted the content to /Game/ folder... but it's nowhere to be found

: / please help

capture.png (217.8 kB)
avatar image Muzaheed Feb 22 '17 at 12:25 PM

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

avatar image panha Feb 22 '17 at 01:17 PM

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)

avatar image joeGraf STAFF Feb 22 '17 at 01:45 PM

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

avatar image panha Feb 23 '17 at 07:52 AM

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 : /

avatar image Muzaheed Feb 23 '17 at 01:14 PM

https://github.com/moritz-wundke/AsyncPackageStreamer

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

avatar image panha Feb 23 '17 at 01:17 PM

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 : /

avatar image DisplaySweet Sep 20 '17 at 06:51 AM

Can you please share your solution? .... we have same issue here and not sure, how to use that code....

avatar image joeGraf STAFF Feb 23 '17 at 02:19 PM

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

avatar image panha Feb 24 '17 at 12:04 AM

I tried this,

/Game/assets/Arrow.Arrow (static mesh) but still can't load : / (again it works on window, but not android. (ps I did cooked assets for both OSs)

(comments are locked)
10|2000 characters needed characters left

4 answers: sort voted first

God damn,... f****

The mistake is so... so really really simple,... and it cost me three weeks : / and this is my final year university project damn....

I downloaded the pak file to /data/data/Myproject/my.pak and mount it from there .... which is part of the engine valid path...

So I have to copy that pak file to FPaths::EngineContentDir() and mount it from there .......

more ▼

answered Feb 26 '17 at 07:27 AM

avatar image

panha
23 6 13 9

avatar image Muzaheed Mar 13 '17 at 03:03 PM

in android where FPaths::EngineContentDir() is pointing at ?

avatar image panha Mar 13 '17 at 11:40 PM

I'm not exactly sure ... Sth like /data/data/packagename/,. It's a string you print it and see... It could be also in form of emulated storage like Android/data/package Name/...

avatar image Muzaheed Mar 16 '17 at 01:49 PM

hmm. most probably you are talking about game persistenDownload dir. located in android/data/packagename/files/

avatar image joeGraf STAFF Mar 16 '17 at 03:27 PM

It needs to be in the persistent download dir for cross platform compatibility. Many devices/consoles have a specific location for that data, so use that so you aren't kicked out of certification.

(comments are locked)
10|2000 characters needed characters left

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

more ▼

answered Feb 20 '17 at 02:05 PM

avatar image

joeGraf STAFF
1.5k 35 12 68

avatar image panha Feb 20 '17 at 02:11 PM

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.

avatar image joeGraf STAFF Feb 20 '17 at 03:03 PM

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.

avatar image panha Feb 20 '17 at 07:51 PM

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?

avatar image Muzaheed May 25 '17 at 02:59 PM

were u able to solve it ?

(comments are locked)
10|2000 characters needed characters left

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

more ▼

answered Feb 21 '17 at 03:23 PM

avatar image

joeGraf STAFF
1.5k 35 12 68

(comments are locked)
10|2000 characters needed characters left

挂载后模型能正常加载,但是贴图加载出来后会花掉。

more ▼

answered Jul 26 '17 at 12:06 PM

avatar image

BIG_bug
1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question