how to build game for android ?

hi (my english is not well )
today i try to build a game for android device but i can not build in ue4
i’ve download android sdk , ant and jdk and set enviroment variable
but unreal make error

Yeah that message is really annoying, we really need something more than ‘Its not working’. It just offers no clue.

I was finally able to get android to work, mostly it fails due to incorrect environment variables or different versions of required software than what it expects. My Setup is:

JAVA_HOME
NDKROOT C:
vpack\android-ndk-r9c
NVPACK_ROOT C:
vpack
ANDROID_HOME C:\android-sdk\sdk
ANT_HOME C:\apache-ant-1.8.2
CYGWIN_HOME C:\cygwin64

In the environment PATH variable add the following to the list

{ANDROID_HOME}/platform-tools
{ANDROID_HOME}/tools
{ANDROID_HOME}/build-tools

I already had Android setup before I started using unreal so a lot of this stuff was already there along with a lot of extras like gradle and maven but I think the above is all you really need. I am not sure you actually need cygwin or the build-tools variable.

I used the TADP executable to install only the NDK and Nsight plugin for Visual Studio. The rest was not needed. You need to have to correct versions of everything or else it won’t work. In my case I had to downgrade some things. Without a better debug message from unreal it is really hard to tell why it is failing. I see you are using JDK 1.8 I have no idea if that is ok but you might be better off with version 1.7

Either reboot or 4.6.1 fixed my Java issue.

Current instructions for manual install and adding of user environment variables works fine on Win 8.1.

JDK(1.8, 8u25), NDK(r10d), ANT(1.9.4), VS 2013 CE, Android Studio(1.0.1) and Cygwin(1.7.33)

You probably forgot to install something or try a reboot. I might not have restarted launcher and only restarted UE and that didnt pick up all changes. That or 4.6.1 fixed my issue. Either way, current instructions work on stock system.

There is work in the pipeline which should improve the Android setup experience a bit, mostly related to environment variables, however it is still a little way off (initial work is most likely to show up in the 4.8 time frame).

**For reference, there is currently an issue where during SDK detection we currently require the NDK environment variable to set and valid even if you are doing a content only project. **
This will get fixed, however there is no time frame currently (I’d like to get it done for 4.8 too as 4.7 is already going through release stages, but no promises) as it isn’t quite as simple as it sounds.