Exporting .apk

Every time I try to export any apk, I always get ERROR: cmd.exe failed with args /c “D:/…/apache-ant-1.9.4/bin/ant.bat” -quiet debug

O tried quite a couple of different apache-ant versions, but I always get this error, therefore, can’t export any .apk in the current version of UE4 (4.7.4)

Any ideas on how to solve that?

Hi Otokomidori,

Firstly, can you attach your entire failed output log to this thread as a text file to this thread?

Without seeing your whole logs, I have a small suspicion you’re having the same problem as this user who posted on the Android forums. Have a look and see if you have the same error in your logs, and that would be your issue.

Thanks!

Yes, indeed I can.

link text

Great, thanks very much. Ok, I’m seeing several SDK errors in your log, and I think it’s related to this:

ERROR: Exception in UnrealBuildTool:
ERROR: cmd.exe failed with args /c
“D:/Apps/apache-ant-1.9.4/bin/ant.bat”
-quiet debug

Can you make sure you have the correct version of Apache Ant that we support installed for your SDK? It should be 1.8.2 at this point. Here is a forum post from another user that shows the correct SDK setup in project settings for Android.

Hope this helps!

Thanks for your reply.

I do also have what you call “the correct version”, but It works out just the same way, so I tried multiple other versions, but no success.
Here’s the other log: link text

Thanks for the logs. And you have your project settings like the picture in the forum post? Feel free to attach a screenshot of your settings to this thread for verification. You may need to restart your machine now that you have set it back to 1.8.2 in order for the settings to take effect.
Thanks!

Yes, sure. Here are my android SDK settings

Thanks for that. Can you set your NDK level to android-19, restart and see if that helps?

MainFrameActions: Packaging (Android (All)): Program.Main: ERROR: ERROR: cmd.exe failed with args /c “D:/Apps/AndroidSDK2/apache-ant-1.8.2/bin/ant.bat” -quiet debug
MainFrameActions: Packaging (Android (All)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (All)): Program.Main: AutomationTool exiting with ExitCode=1
MainFrameActions: Packaging (Android (All)): Domain_ProcessExit
MainFrameActions: Packaging (Android (All)): ProcessManager.KillAll: Trying to kill 0 spawned processes.
MainFrameActions: Packaging (Android (All)): copying UAT log files…
MainFrameActions: Packaging (Android (All)): RunUAT.bat ERROR: AutomationTool was unable to run successfully.
MainFrameActions: Packaging (Android (All)): BUILD FAILED

:frowning:

Still the same :S

You’re restarting your computer when you make the SDK changes, right?

Can you try to package the Tappy Chicken project for development and ETC1 and attach the full output logs to this thread as a txt file? Thanks!

I did restart the computer after, that’s true. Here is the log of flappy bird: link text

Excellent, thank you. I see that succeeded, but your other build is still failing? I still see what looks like SDK errors, though, do you have any other SDK setup that could be incomplete, like say, Gear VR?

Correct. My personal project still fails to export. Only full SDK that I have is the one that came with unreal itself. Besides that, I have a newest version of apache ant, which, unexpectedly, looks like isn’t compatible with unreal. So I plugged the original one back in. No gear VR in any way.

Ok, I should have asked this before, but are you running source or binary?

Well, I’m really sorry, but I’d be glad if you told me how to figure that out… That’s what you get when you make designers be able to be a programmer also. :confused:

Binary is the editor version you get from the launcher, and source is the version you get from Github that requires compiling with Visual Studio. From your answer I am assuming binary, yes? :smiley:

I suppose that’s true :smiley:

Hi Otokomidori,

I’ve found the error in your personal project logs that is the cause:

D:\Apps\AndroidSDK2\android-sdk-windows\tools\ant\build.xml:542:
Application package ‘Otokomidori
Productions’ must have a minimum of 2
segments.

Luckily, this exact issue was addressed this week on the Android forums, with an explanation of how to fix it. Somewhat less luckily, if you end up seeing the same error as that user:

ERROR: Can’t make an APK without the
compiled .so [F:\Unreal
Projects\Vehicle
Game\VehicleGame\Binaries\Android\VehicleGame-armv7-es2.so]

You will be obliged to go into Visual Studio and compile. Chris Babcock mentioned in that thread the settings for that compiling, and here is the documentation that will walk you through compiling your project.

Good luck!

I really appreciate your answer and work looking for it. Basic export works fine now. But there is one problem lol xD… Destribution build doesn’t work :smiley:
link text