We’ve been developing exclusively with blueprints up until this week, but have decided to port some of our logic to native. We also need to implement an engine fix for Android save games not working correctly, so decided to grab the full engine source code and build it ourselves.
Everything’s gone fine and we managed to compile the engine, created some C++ files for our project and build/run the game on PC. But we’ve not been able to get Android to work at all.
Initially we were trying to run the game on an Android phone via the editor (like we’d been doing when it was blueprints only) but that failed to deploy (can’t remember what the error was now, sorry). I tried publishing an apk too, but that didn’t work either. After some investigation, I came to the conclusion that this was because the code for our game project wasn’t compiled for Android, and so it couldn’t deploy
If I’ve got this right, after making changes to our own project’s native code, we need to select the Android development configuration and build it? Then we should be able to deploy to an Android device in the editor as usual? Every time I’ve tried to do that I’ve run across the following compile errors:
1>------ Build started: Project: UE4, Configuration: Development_Game Tegra-Android ------ 1> Compiling Native code with NDK API 'Android 19' 1> Performing 195 actions (4 in parallel) 1> [1/195] clang++.exe EnginePrivate.h [armv7-es2] 1> [2/195] clang++.exe RendererPrivate.h [armv7-es2] 1> [3/195] clang++.exe CorePrivatePCH.h [armv7-es2] 1> [4/195] clang++.exe Module.Paper2D.cpp [armv7-es2] 1> In file included from E:/Subversion/Unreal/Engine/Intermediate/Build/Android/UE4/Development/Renderer/RendererPrivate.h:4: 1> In file included from E:\Subversion\Unreal\Engine\Source\Runtime\Renderer\Private\RendererPrivate.h:10: 1> In file included from Runtime/Engine/Public\Engine.h:9: 1> In file included from Runtime/Core/Public\Core.h:16: 1>E:\Subversion\Unreal\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(6,9): fatal error : 'wchar.h' file not found 1> #include <wchar.h> 1> ^ 1> In file included from E:/Subversion/Unreal/Engine/Intermediate/Build/Android/UE4/Development/Engine/EnginePrivate.h:4: 1> In file included from E:\Subversion\Unreal\Engine\Source\Runtime\Engine\Private\EnginePrivate.h:8: 1> In file included from Runtime/CoreUObject/Public\CoreUObject.h:7: 1> In file included from Runtime/Core/Public\Core.h:16: 1>E:\Subversion\Unreal\Engine\Source\Runtime\Core\Public\HAL\PlatformIncludes.h(6,9): fatal error : 'wchar.h' file not found 1> #include <wchar.h> 1> ^
(And so on…)
I tried building Development Android both for the UE4 project and our own, but I always get those errors. I tried a ton of suggestions online to fix it, but nothing helped. In the end, I figured I must have a broken configuration and wiped everything out (Android SDK, Visual Studio, the Unreal build) and started again from scratch, doing the following:
- Installed Program Files\Epic Games\4.8\Engine\Extras\Android\tadp-2.0r8-windows.exe, using all of the default settings and making sure everything installed properly.
- Installed a cleanly downloaded version of Visual Studio 2013 Community edition and installed it with default options. Everything seems fine from there.
- Forked Unreal 4.8.1 from git hub and downloaded it as a .zip (last time I used git directly and decided to try it a different way this time). Extracted it to a folder, ran Setup.bat and then ran GenerateProjectFiles.bat. Again, no problems.
- Switched to Development Editor Win64 and rebuilt the whole thing. Compiled without issues and the editor runs successfully.
- Switched to Development Android and tried to build UE4. Exactly the same error.
At this point I’ve run out of things to try. I’ve either got the wrong end of the stick about deploying to Android, or there’s a problem that I can’t seem to find a solution for.
Thanks for any assistance you can provide,