Android Package For Distribution Error (Shipping)

Hello, i have been struggling with many packaging problems this week, but i am getting this one that i just cannot figure out what i have to do and it is really delaying progress. Here is the situation:

I am able to successfully… :

  • Package game for development (‘Android All’)
  • Package game for shipping (‘Android All’)

I am unable to… :

  • Package game for shipping and distribution ('Android All’)
    (It says… ‘BUILD FAILED’ Just after the line ‘Signing Final apk…’ – More info below!)

  • Package * “Tappy Chicken” * for shipping and distribution (‘Android All’)

I have… :

  • Installed ‘Tegra Android Development Pack’ from the engine’s extra folder
  • Created keystore file for my game and placed it within the projects 'Build\Android' folder
  • Entered keystore information into the project properties under ‘Android’ (alias, name, password)

I have tried… :

  1. Restarting PC after installing/updating android sdk,ant,jdk,ndk etc from the SDK Manager
  2. Migrated whole project to a new empty project
  3. Downloading a ‘Proguard’ folder and Proguard.txt file and replacing the current SDK version one to the one downloaded (Recommended on a different forum/site)
  4. Creating a new keystore file and replacing previous one with this new one to see if i set it up wrong. (and placed in the same folder as before)

Here is a screenshot of the last page of the output log. (open in new tab)

Here is the entire ‘Log’ file of the build. (I could not find a log file for the test build i just did so i just copied the text from when it started building until the end, i hope that is ok?)

[Entire Log File Output][2]


Here is some screenshots of my situation:


That has surely got to be enough info to get some help on this thing?
If anyone can help it would be appreciated! I am getting really quite desperate now.
Thanks.


Im getting the same error in 4.8.1, it packaged correctly for shipping build and deploy on device initially, now it gets the ant.bat error every time, same project in 4.7 works fine

Same here. I even try reinstalling the Unreal Engine.

its something to do with adding your android package name in my case, if I delete all build info from project then it will build as soon as I add package name it gets the ant.bat error

Ok I fixed it for me. This is what I did.

  1. Created Keystore file with Android
    Studio.
  2. Delete the “Build” folder from my
    Project folder.
  3. Enable “For Distribution” in
    Packaging Section.
  4. In Distribution Signing, fill out
    all information I made in Android
    Studio and in the Key Store area,
    wrote out the Keystore file name I
    created from Android Studio with the
    file extension. ex: MyKeystore.jks
  5. Then click “Configure Now”.
  6. Now I went back to my Project
    folder, which now the “Build” folder
    is created.
  7. I copy my Keystore file
    (MyKeystore.jks) and put it in
    Build/Android folder. Then I
    packaged my project. It worked
    every time I did it this exact way.

My mistake was not writing the file extension (.jks) for MyKeystore
and not deleting the “Build” folder first or after messing up so much.

Hope this helps!

I have tried this using the keystore I originally used in 4.6 and it will build if the package name is the default, as soon as I change to my package name, which I obviously need so it matches my existing googleplay game apk, it wont build, Ive tried formating differently, changing tadp versions, hopefully 4.8.2 fixes this issue, I assume its something to do with 4.8.1 as it works fine in earlier versions, I specifically wanted to use 4.8 for the .obb compresion, which they just removed in 4.81 lol

I didn’t realize they took out the .obb compression. smh.

You might have tired this but delete the build folder, then change your name, fill out the Distribution Signing and click “Configure Now”. I had the same problem with changing the name but doing it this way fix my problem.

I will try it in that order specifically , I hope they bring the compression back, I have tried to use compression via command line on .obb after build nothing works though, although when I upload .obb to googleplay It tells me I could be compressing and size reduction would be significant

Using 4.6.1 here, still no luck with your fix, any help?

Hi All,

Compression was not removed for 4.8.1, which was a bug/crash hotfix only, no features were added or removed.

I am not sure why compression in the command line isn’t working for you, WarpSpasm, other than you also have to have -pak since it is compressing the pak file. There’s also a new checkbox in the editor itself for compression, it’s under Project Settings > Project - Packaging. Checkbox is ‘create compressed cooked packages’. So I’m not 100% sure why you’re thinking compression was removed, it’s actually been made easier to access.

Without output logs, I have no idea if any of you are seeing the same problem as the OP Lawrie, but their issue is not having sing.keystore setup, here is the actual error from their logs:

C:\NVPACK\android-sdk-windows\tools\ant\build.xml:1151: C:\Users\Lawrie\Documents\Unreal
Projects\Rotator_Android\Intermediate\Android\APK\mykey
(The system cannot find the file
specified)

And here is how to set that up correctly. I’m betting it’s the distribution signing part in Platforms - Android that is wrong, if the key is called mykey, it should be mykey.keystore.

As far as everyone else experiencing the ant.bat error, it is unfortunately a very generic error that could be caused by any number of issues. Here is a thread with many possible causes to check. Also, if you’re seeing this in the move from 4.8 to 4.8.1, it’s possible something has corrupted, in which case:

In the Engine folder, delete the DDC (Derived Data Cache). In your project, delete the Intermediate, the Saved, and the Binary folders.

When you next try to package it will take considerably longer as the shaders will need to newly compile, but this should get rid of any old or corrupted files that haven’t gotten deleted.

good luck all.

There was an option ‘use compression on .obb file’ in the android project settings, Im sure I saw it there, unless im having a mental breakdown, which is possible lol…I tried the ddc and deleting the folders from project, still got the ant.bat error though, it did however build using robinsons steps involving the configure now button, and with the compression option mentioned it appears the .obb is one third of the size before, hopefully it will upload to googleplay without a problem…thanks for your help
EDIT- Project will not launch on android device now though…it did run on device in 4.8.0

mykey should be mykey.keystore but you still can’t get a Shipping/Distribution to work I’m having the same problem. I think it has to do with the game now being put into a folder UE4Game.

So even when you’re able to build a “For Distribution” / Shipping game it will not work from the app store or installing it locally. For now you’re stuck with a non Distribution / Shipping game

I’m having the exact same problem

Working:

Build configuration: Shipping

Full rebuild

Not Working:

Build configuration: Shipping

Full rebuild

For Distribution

-

A full shipping for distribution build will give the error:

Failed to open descriptor file

As for the mykey.keystore

put it in the

\ProjectName\Build\Android\ - folder

Simply said you can not release/test android/games at all now with UE4 how great is that

I have packaged for shipping, with compression, on 4.8.1, and it plays on the device just fine with ads, leaderboards, achievements… the works. Just letting you know that the engine CAN do it.

KillerSneak, you are possibly having unrelated issues to these, but you’re reopening and posting this same info across several already closed threads. I’ve already asked you in this other closed thread for more information, so I’m going to close this one as answered.

You can either keep your issue to the thread where I answered you and we can discuss your particular issue there, or if you like, you can even open your own thread but it will need more information than the links to other closed AH threads. Here is some instructions on what is best to include, additionally build output logs and even logcat logs if you’re seeing the failed to open descriptor file, and on what devices you’re testing.

Thank you.