4.12.5 IOS Metal crash using LoadingScreen

4.12.5 IOS metal Game is Crash

I don’t speak English well. Sorry.

I was packaging my game IOS on Metal option.

I use Movie Player in GameInstance

void	UMyGameInstance::Init()
{
	Super::Init();
	FCoreUObjectDelegates::PreLoadMap.AddUObject(this, & UMyGameInstance::BeginLoadingScreen);
	FCoreUObjectDelegates::PostLoadMap.AddUObject(this, & UMyGameInstance::EndLoadingScreen);
}

void	UMyGameInstance::BeginLoadingScreen()
{	
	FLoadingScreenAttributes LoadingScreen;
	LoadingScreen.bAutoCompleteWhenLoadingCompletes = false;
	LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
	GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
}

void	UMyGameInstance::EndLoadingScreen()
{
}

I add MoviePlayer Module in build.cs

code compile success.

And I regist UMyGameInstance ProjectSetting in UE4Editor

I checked only “Supports Forward Rendering with Metal” and package IOS ( use IPadMini2 )

Game run splash screen well.

But next open main game level is not run.

How to fix this problem?

Game log on IOS [link text]

Hey -

Can you try updating the device OS to at least 9.3.1 and let me know if the crash still occurs. If the crash does continue to occur, can you provide the setup you used to create the loading screen?

As a temporary workaround, you should be able to go into Project Settings->Platforms->iOS and type Metal into the search bar. If you then uncheck the box for “Support Forward Rendering with Metal” it should deactivate Metal and allow the packaged project to run without crashing.

Hi, Thank you for the reply.
UE 4.12.5
iPadmini2 OSVersion: 9.3.2
iMac OS 10.11.6
Xcode 7.3.1

I open UE4Editor.app and make FPS Templete Project (base on c++)
I add Movie Player code (LoadingScreen) in Gameinstance.cpp and h


    #pragma once
    
    #include "Engine/GameInstance.h"
    #include "IOSTestGameInstance.generated.h"
    
    UCLASS()
    class IOSTEST_API UIOSTestGameInstance : public UGameInstance
    {
    	GENERATED_BODY()
    	
    protected:
        virtual void    Init() override;
        UFUNCTION()
        void    BeginLoadingScreen();
        
        UFUNCTION()
        void    EndLoadingScreen();
    };

    #include "IOSTest.h"
    #include "IOSTestGameInstance.h"
    #include "MoviePlayer.h"
    
    void	UIOSTestGameInstance::Init()
    {
        Super::Init();
        
        FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UIOSTestGameInstance::BeginLoadingScreen);
        FCoreUObjectDelegates::PostLoadMap.AddUObject(this, &UIOSTestGameInstance::EndLoadingScreen);
    }
    
    void	UIOSTestGameInstance::BeginLoadingScreen()
    {
        FLoadingScreenAttributes LoadingScreen;
        LoadingScreen.bAutoCompleteWhenLoadingCompletes = false;
        LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
        
        GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
    }
    
    void	UIOSTestGameInstance::EndLoadingScreen()
    {        
    }

This image is my ProjectSetting


That is all.

IOS rendering option : only check “Supports Open GLES2” → Then Game in LoadingScreen run well without crash.

But i want to use “IOS Rendering Metal”…

There are a number of errors getting the code you provided to compile for me. If the sample project you’re using only has the GameInstance class added, could you provide that project for me to test directly? Also, can you provide your callstack from the crash for additional information?

Thank you reply.

I don’t know how to get callstack, sorry.

But this is Game.log file [link text][1]

Sample Templete : First Person Shooting

My project Name : IOSTest

GameInstance.h and GameInstance.cpp code is same as before comment

And My Build.cs

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class IOSTest : ModuleRules
{
	public IOSTest(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "MoviePlayer" });
	}
}

and

My project Tree

Packaging IOS with “Support Forward Rendering with Meal” is not open GameDeault Map and shut down.

Help me plz.

Hey -

You are seeing this crash when the movie being to play correct? Can you explain how you’re calling the functions in your game instance? Also, what is the device you’re seeing the crash on? Can you check if the device has iOS8 and an A7 or better processor as these are required for the Support Forward Rendering with Metal option.

Hi . Thanks reply.

I use iPadmini2 ( processor = A7 , OS = 9.3.4 )

I was testing loading screen in Sample Project (FPS Templete)

I use Loading screen code in this link . [link text][1]

And I changed option ( ProjectSetting - IOS - Rendering )

I tested game (package iPadmini2) 2 case.


case 1.

104727-bb.jpg

Splash screen open well.

GameDefaultMap open well.

No problem. Loading screen works very good.


case 2.

104728-aa.jpg

Splash screen open well.

But GameDefaultMap did not open and Game immediately shut down. ( Loading screen did not show )


I think cause of this problem is [iOS Metal option and Loading screen].

Just I used Templete Project and Source code in UE4 wiki.

I want to use “IOS Rendering Metal” and “Loading Screen (use Movie Player)”.

Help plz.

Hey -

I copied the code from the page you linked into a new project, without further information, this was not causing any crash for me when I transferred levels. In order to test the actual issue itself, would it be possible for you to provide a copy of the project where movie player / Metal is causing the crash?

Hi

I could not upload MyProject, because File upload size is 5.2MB

I used 4.12.5 pure engine source (downloaded in github).
And Make FirsetPerson C++ Templete Project.

My SourceCode File link link text

---- My DefaultEngine.ini ---------

[/Script/EngineSettings.GameMapsSettings]
...
...
GameInstanceClass=/Script/CodeTest.TestGameInstance
...
...
    
    
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
...
...
bSupportsOpenGLES2=False
bSupportsMetal=True
...
...

----My DefaultGame.ini ------

[/Script/UnrealEd.ProjectPackagingSettings]
...
...
+MapsToCook=(FilePath="/Game/FirstPersonCPP/Maps/NextLevel")
+MapsToCook=(FilePath="/Game/FirstPersonCPP/Maps/FirstPersonExampleMap")
...
...

That is all.

Package iOS Game.
Splash Screen run well.
GameDefaultMap (FirstPersonExampleMap.umap) didn’t run, and shut down Game.


other case. ( bSupportsOpenGLES2=True, bSupportsMetal=False )

Package iOS Game.
Splash screen run well.
GameDefaultMap run well.

and pop console window → input “open NextLevel” or “open FirstPersonExampleMap” → loading screen (movie player) run well.

But ( bSupportsOpenGLES2=False , bSupportsMetal=True )
no run game.
Help plz.

Hey -

I apologize for the delayed response. After further attempts to reproduce your issue I have not had a crash occur. When attempting to upload your project were you uploading it directly to AnswerHub or somewhere else? If you’re able to upload your project to google drive or dropbox, you can simply post the download link for the project. If the project is zipped before uploading it should reduce file size of the upload.

Thanks reply

Engine Version is 4.12.5

Here is My Project Link in Google Drive.

link text

bSupportsOpenGLES2=False , bSupportsMetal=True

I hope to resolve this issue.

Hey -

Thank you for the sample project. I was able to reproduce the crash and have entered a report for the issue that you can follow here: 4.12.5 IOS Metal crash using LoadingScreen - Mobile - Epic Developer Community Forums

Cheers

Hey -

As a follow up, could you let me know if you have the same issue after making a copy of your project and opening / packaging it in 4.13? The sample project you sent is unable to compile/open in 4.13 on my end.