Game crashes on Android [MAX_SERIAL_NUMBER_BLOCKS error]

Hi there. I made a [forum topic][1] earlier on with no success on how to solve this issue.

When I’ve 1 enemy actor with AI and BT, everything is running fine.
However when I add a second enemy actor that is using also AI and BT, the game crashes (it doesn’t matter if the 2nd actor has it’s own AI and BT or uses the same one as the first enemy actor.

The error I get is:

08-20 18:18:41.080: D/UE4(27387): [2015.08.20-16.18.41:086][  0]LogMemory: 24832K allocated in pools (with 2176K slack and 1472K waste). Efficiency 94.07%

08-20 18:18:41.080: D/UE4(27387): [2015.08.20-16.18.41:086][  0]LogMemory: Allocations 131488 Current / 2474125 Total (in 388 pools)

08-20 18:18:41.080: D/UE4(27387): [2015.08.20-16.18.41:086][  0]LogMemory: 

08-20 18:18:41.410: D/UE4(27387): [2015.08.20-16.18.41:418][  0]LogLinker:Warning: CreateImport: Failed to load Outer for resource 'WidgetTree': WidgetBlueprint /Script/UMGEditor.Default__WidgetBlueprint

08-20 18:18:42.695: D/UE4(27387): [2015.08.20-16.18.42:701][  0]LogLinker:Warning: CreateImport: Failed to load Outer for resource 'WidgetTree': WidgetBlueprint /Script/UMGEditor.Default__WidgetBlueprint

08-20 18:18:42.775: D/UE4(27387): [2015.08.20-16.18.42:783][  0]LogLinker:Warning: CreateImport: Failed to load Outer for resource 'WidgetTree': WidgetBlueprint /Script/UMGEditor.Default__WidgetBlueprint

08-20 18:18:45.765: D/UE4(27387): [2015.08.20-16.18.45:773][  0]LogAIModule: Creating AISystem for world Map_Survival
08-20 18:18:45.860: D/UE4(27387): [2015.08.20-16.18.45:866][  0]LogWorld: Game class is 'GMode_Survival_C'

08-20 18:18:46.010: D/UE4(27387): [2015.08.20-16.18.46:017][  0]LogWorld: Bringing World /Game/Maps/Map_Survival.Map_Survival up for play ( tick rate 0) at 2015.08.20-18.18.46

08-20 18:18:46.090: D/UE4(27387): [2015.08.20-16.18.46:097][  0]LogWorld: Bringing up level for play took: 0.182924

08-20 18:18:46.145: D/UE4(27387): [2015.08.20-16.18.46:152][  0]LogOnline:Warning: NULL: Can't start an online game for session (Game) that hasn't been created

08-20 18:18:46.170: D/UE4(27387): Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\CoreUObject\Private\UObject\WeakObjectPtr.cpp] [Line: 78] 

08-20 18:18:46.170: D/UE4(27387): [Index:1712969744] exceeds maximum number of UObjects, [Block:104551] increase MAX_SERIAL_NUMBER_BLOCKS

08-20 18:18:46.175: D/UE4(27387): [2015.08.20-16.18.46:182][  0]Assertion failed: Assertion failed:  [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.8\Engine\Source\Runtime\CoreUObject\Private\UObject\WeakObjectPtr.cpp] [Line: 78] 

08-20 18:18:46.175: D/UE4(27387): [Index:1712969744] exceeds maximum number of UObjects, [Block:104551] increase MAX_SERIAL_NUMBER_BLOCKS

PS: I’m using Samsung Galaxy S3 GT-I9300.

Hello,

In order to assist you further, I’m going to need your full provided. What’s provided within the show isn’t enough to verify that those lines of code are specifically why you’re having trouble. Please upload them as a .txt file when you’re able to.

Thank you and have a nice day. :slight_smile:

Hi ,

thank you very much for your reply. I’ve hooked up my device to the computer and pulled out the .
Please see the txt file bellow. You mention ‘them’ when refering to the . These are from the monitor.bat from the NVIDIA pack.
I hope this is sufficient. If not, could you please specify what you need? (I’m still learning which tells what :))

Thank you for your time and have a good weekend :slight_smile:

[Full Error Log][1]

55294-sc_fullerrorlog_22082015.txt (47.1 KB)

So… looking at the lack of replies, this error is a mystery?

Hey Singetsua,

I’ve been in touch with our Developers and we believe that there is an issue before it hits the assertion in WeakObjectPtr.cpp. The Block count is a lot higher than it should be. In order to track it down fully, it looks as though we’re going to need reproduction steps. Do you have any idea on what is causing this error, or what you may have added in before it started having asserts at WeakObjectPtr.cpp?

If not, are you using the GitHub version of the Engine, or do you know programming? If so, we suggest trying the following:

if (LinkedProgram == NULL)
					{
						const SIZE_T StackTraceSize = 65535;
						ANSICHAR* StackTrace = (ANSICHAR*)FMemory::Malloc(StackTraceSize);
						StackTrace[0] = 0;

						// Walk the stack and dump it to the allocated memory.
						FPlatformStackWalk::StackWalkAndDump(StackTrace, StackTraceSize, 0, NULL);
						FPlatformMisc::LowLevelOutputDebugString(StackTrace);
						FMemory::Free(StackTrace);
					}

Add this information in before the UE_LOG on line 78 in WeakObjectPtr to dump out the call stack so that we can figure out what exactly is going on.

Looking forward to hearing back from you, thanks!

Hi, . I’m very happy to see your reply!

I’ve some knowledge of programming from Java, C++ seems to be similar.
I think I can do this :slight_smile: (I know where the file is and I can edit it. Not really sure if the Engine picks up the edit from the cpp file tho :P)

For the issue it self, I’ve had this issue in a previous project as well. I’ve no clue what is causing it. I’ve ordered a Samsung Galaxy S4 Mini to see if it’s happening on this one too (it should arrive this week).

If required/wanted I can upload the project to my host in zip/rar format so you can check it out. As far I’m aware you (Epic) have no S3 to test with. I believe it’s android-16 (Jelly Bean).

For the Engine, I’m using the one via the Launcher. not the GitHub version.
It’s the current version 4.8.3.

Again thank you for your reply and I’ll attempt this evening your advice.

Hey,

We do have an S3 but it’s not on JellyBean, but we also have a Galaxy Tab 7 that’s on JellyBean which I could check as well. Let me know what your outcome is after you’ve tried what’s suggested.

Thanks!

Hi ,

I’ve attached the , please see the attachments.

[Monitor log][1]
[UE4 Editor log][2]

56000-monitor_log_27082015.txt (46.4 KB)
[2]: 56001-u4editor_log_27082015.txt (50.5 KB)

Dos console log:
[Dos console log][1]

56002-dosconsole_log_27082015.txt (110 KB)

I’ve the feeling that I did something wrong with entering the code in to WeakObjectPtr. I added it using notepad and then launched the engine.

Do I need to compile it or something? The seems to be the same except for date and time stamps.

Hey,

Would you be able to provide us the the file or a screenshot of where you’ve entered the code to ensure that it’s in the correct location? I have requested for some additional details from our Android Developers, so hopefully we’ll have additional information for you soon.

Thank you!

Hi,

I’ve placed it in: Program Files\Epic Games\4.8\Engine\Source\Runtime\CoreUObject\Private\UObjectWeakObjectPtr.cpp

Before line 78 (above the UE4_LOG line)

Please see attached screenshot, I’ve highlighted the script.

Hi, i’ve tried to run it on a Galasy S4 Mini (KitKatt), but it has the exact same problem :frowning:

Hey Singetsua,

It looks as though you added code but did not compile it.

Use the GitHub build and you will need to rebuild configuration Development platform Android for the UE4 Project in Visual Studio. Once you have done that, you should be able to package or launch your game with the new UE4Game-armv7-es2 which will create an Android folder in 'Engine/Binaries/Android.

Thanks! :slight_smile:

I made my project using blueprints, will I have to redo it all in C++?
My knowledge of C++ is very minimal (at the moment).

There is no need to change the project; just load the ue4.sln created by generateprojects.bat into Visual Studio, select configuration Development and platform Android (or Tegra-Android), and rebuild UE4 project. This will update the UE4Game-armv7-es2.so (in Engine/Binaries/Android) included in the APK when you package or launch on.

Hi, I made a build with Development - Android, but it didn’t gave me a UE4Editor.exe. So I’m doing a Development Editor - Win64 build now so that I get the UE4Editor.exe aswell.

I’m not sure if the UE4Game-armv7-es2.so gets rewritten and I’ve to make a rebuild for Development-Android again after…

(I never worked from VS before). I’ll post the results.

Well, after compiling the engine with development-android and launching it up, after rebuilding the project it still crashed on the same place.

I noticed in the log of the engine build that it used the new UE4Game-armv7-es2.so.

Please see the log file attached.

[link text][1]

56834-monitor_bat_log.txt (53.4 KB)

I didn’t add the code yet to WeakObjectPtr.cpp

I’ve added a screenshot where I placed the code.

I’ve added it, but when I rebuilt it, it returns the following errors:

Error	1	error C2065: 'LinkedProgram' : undeclared identifier	
Error	2	error C2664: 'void FGenericPlatformMisc::LowLevelOutputDebugString(const TCHAR *)' : cannot convert argument 1 from 'ANSICHAR *' to 'const TCHAR *'	
Error	3	error : Failed to produce item: H:\Corvus Game Studio\UE4-Git\UnrealEngine\Engine\Binaries\Win64\UnrealHeaderTool-CoreUObject.dll	
Error	4	error MSB3075: The command "..\..\Build\BatchFiles\Rebuild.bat UE4Game Android Development" exited with code 5. Please verify that you have sufficient rights to run this command.
	5	IntelliSense: identifier "LinkedProgram" is undefined	
	6	IntelliSense: argument of type "ANSICHAR *" is incompatible with parameter of type "const TCHAR *"
	7	IntelliSense: object of abstract class type "FSerialNumberManager" is not allowed:
            pure virtual function "FUObjectArray::FUObjectDeleteListener::NotifyUObjectDeleted" has no overrider	
	8	IntelliSense: class "FSerialNumberManager" has no member "GetAndAllocateSerialNumber"
	9	IntelliSense: class "FSerialNumberManager" has no member "GetSerialNumber"	

I hope we can find a solution for this problem, in any case I’ve learned a lot and coming to a better understanding of the tooling I can use.

Hey,

It looks like you didn’t compile for Development Android after making the change to the code. We also noticed that the “if (LinkedProgram == NULL)” line shouldn’t be there.

  • Make sure you run “GenerateProjectFiles.bat” to create the project files and UE4.sln
  • Open UE4.sln in Visual Studio 2013
  • Select “Development” from the solution configurations
  • Select “Android” or “Tegra-Android” from the solution platforms
  • Open up Engine and right click on UE4 and select Rebuild

That should do it. If you want to confirm, check in Engine/Binaries/Android and see the timestamp on UE4Game-armv7-es2.so; it should be new. Now you can use this for launching or packaging.

With that being said, please provide the stack dump so we can figure out why your project is having these issues.

Thank you!