After upgrading the UE4 4.8 I’m running into an Android compile error with the generated code.
I have a field defined that checks for the android platform symbol in the actor header.
#if PLATFORM_ANDROID tv_ouya_console_api_content_OuyaMod::OuyaMod _ouyaMod; #endif
The implementation file also has an android platform check.
AOuyaMod::AOuyaMod(const class FObjectInitializer& PCIP) : Super(PCIP) #if PLATFORM_ANDROID , _ouyaMod(0) #endif
Yet the Engine.generated2.cpp code is acting like it ignored the android platform check.
Error 3 error : constructor for 'AOuyaMod' must explicitly initialize the member '_ouyaMod' which does not have a default constructor C:\Public\OUYA_UnrealEngine-4_8\Engine\Intermediate\Build\Android\UE4Client\Inc\Engine\Engine.generated.2.cpp 4530 31 UE4
Maybe generate project files missed setting a symbol in the project? This is something that worked fine in 4.7 and broke after the 4.8 upgrade.
Here is the working branch:
https://github.com/tgraupmann/UnrealEngine/tree/4.7-OUYA
And I’m upgrading to 4.8 in the new branch.
https://github.com/tgraupmann/UnrealEngine/tree/4.8-OUYA
Here a link to the valid header on 4.7.
https://github.com/tgraupmann/UnrealEngine/blob/4.7-OUYA/Engine/Source/Runtime/Engine/Classes/OuyaSDK/OuyaMod.h#L222
Here a link to the valid implementation on 4.7.
https://github.com/tgraupmann/UnrealEngine/blob/4.7-OUYA/Engine/Source/Runtime/Engine/Private/OuyaSDK/OuyaMod.cpp#L59
I usually define the PLATFORM_ANDROID symbol in the Android make file.
Defining the PLATFORM_ANDROID symbol was not previously required:
https://github.com/tgraupmann/UnrealEngine/blob/4.7-OUYA/Engine/Build/Android/Java/jni/Android.mk
Update:
I’ve added explicit Android platform checks:
https://github.com/tgraupmann/UnrealEngine/commit/f61847ddfdfb505cd12507ef6181296485a9ff1b
Development Editor - Win64 builds successfully.
Development Client - Android fails to build with a few errors like a project is missing the PLATFORM_ANDROID symbol when the source is generated…
I’m down to three odd errors…
Error 3 error : constructor for 'AOuyaModEditor' must explicitly initialize the member '_ouyaModEditor' which does not have a default constructor C:\Public\OUYA_UnrealEngine-4_8\Engine\Intermediate\Build\Android\UE4Client\Inc\Engine\Engine.generated.2.cpp 4892 31 UE4
AOuyaModEditor::AOuyaModEditor(const class FObjectInitializer& PCIP) : Super(PCIP) #if PLATFORM_ANDROID , _ouyaMod(0) , _ouyaModEditor(0) , _callbacksContentSave(0) #endif { }
Error 4 error : constructor for 'AOuyaModScreenshot' must explicitly initialize the member '_ouyaModScreenshot' which does not have a default constructor C:\Public\OUYA_UnrealEngine-4_8\Engine\Intermediate\Build\Android\UE4Client\Inc\Engine\Engine.generated.2.cpp 4973 31 UE4
AOuyaModScreenshot::AOuyaModScreenshot(const class FObjectInitializer& PCIP) : Super(PCIP) #if PLATFORM_ANDROID , _ouyaModScreenshot(0) #endif { }
Error 5 error : constructor for 'AOuyaContent' must explicitly initialize the member '_ouyaContent' which does not have a default constructor C:\Public\OUYA_UnrealEngine-4_8\Engine\Intermediate\Build\Android\UE4Client\Inc\Engine\Engine.generated.1.cpp 52445 31 UE4
AOuyaContent::AOuyaContent(const class FObjectInitializer& PCIP) : Super(PCIP) #if PLATFORM_ANDROID , _ouyaContent(0) #endif { }