Android package error after keystore info implemented

Greetings!

Okay, so I have been working on an app for a while now, and I’m more or less done. The only thing I think is remaining is getting the Distribution Signing correctly implemented. The app was packaging perfectly fine until I included the generated keystore info in the Project Settings under Distribution Signing. Now suddenly I get a build failed message.

Do know I have looked through other people’s troubles here on answerhub, but haven’t found any that solved this problem.

In the “Output of Keytool” field, I’ve filled in the path to the file the keytool generated. In my case: C:/Users//AppName.keytool – I’ve also tried moving the file to the engine’s suggested path (Project/Build/Android), with the same result.

Furthermore, the Key Alias and Key Store Password should be correct, as they are the same as I created when running the keytool.

I suspect this is an easy fix for someone more knowledgable than me, and any help will be deeply appreciated :slight_smile:

Attached is a screenshot of the last part of the error message, where it seems the error is occurring:

Anyone? I really need help with this.

My bad, I should have included the entire error log as a text file. So here it is. Again, I really need help in solving this - both for my self and my students.

[link text][1]

110013-error+log.txt (251 KB)

Hey 3xist3nc3,

Please review this [AnswerHub Post][1], your answer should be there.

Thanks!

ERROR when i package my game - Platform & Builds - Epic Developer Community Forums

Hi, ,

a big thanks for answering! I can assure you I have read, tried and followed the instructions in that post, plus (I guess) all of the other ones dealing with just the problem I’m facing now, and to no avail. Some of what I’ve tried:

  • Having the .keystore file in different folders and at different locations (changing the path inside the engine accordingly), as some people have made it work by changing its location.

  • Others got it to work simply by fixing misspellings in the file’s path, or added extra sets of / - or setting them in other direction. I have tried it all.

  • Some fixed the problem by changing the path inside some other file - unfortunately, I don’t remember the file extension right now, and can’t check - but I tried that as well.

  • I have also tried different distribution settings, different Android builds, and whatever other settings - just to see if the error message changed at all.

  • Tried deleting the Intermediate folder while UE4 was off, as I read somewhere it could potentially fix it.

Therefore, I am clueless. From what I understand of the errors, these are the trouble makers:

The following error occurred while executing this line:
MainFrameActions: Packaging (Android (All)): D:\android-sdk-windows\tools\ant\build.xml:1147: Value for ‘keystore’ is not valid. It must resolve to a single path

Cannot find file D:[ PROJECTS ]\UE4 _ Projects\UE4 Android _ Projects\MeditateNOW\Intermediate/Android/APK/bin/MeditateNOW-release.apk.

Nr. 1: Yes, I think this is correct, as the .keystore is in the project folder, which should mean they’re resolving to a single path (that was another one’s solution).

Nr. 2: The release.apk-file it’s looking for does not exist, as far as I see. Someone else on here didn’t find it either, but he managed to fix the error simply by fixing some misspellings in the path name. I’m not that lucky.

Awaiting your enlightening directions :slight_smile:

Delete your Intermediate and Saved folder from your project folder. Make sure that your keystore is added to YourProject/Build/Android. If it’s not, please create a new one by following [this documentation][1].

If you could upload some screenshots of your Android settings, including the keystore showing up in your folder and the SDK settings, that would be great.

Signing Android Projects for Release on the Google Play Store with Unreal Engine | Unreal Engine 5.1 Documentation

Hi once again, ,

I am so sorry for waiting this long before answering - there’s just been a lot happening. Anyway, eventually, I found out what caused the problem … and it was a laughably easy solution:

As I wrote in the first message: “In the “Output of Keytool” field, I’ve filled in the path to the file the keytool generated. In my case: C:/Users//AppName.keytool – I’ve also tried moving the file to the engine’s suggested path (Project/Build/Android), with the same result.

The problem wasn’t where the file was placed, but rather that I filled in the entire path to the keystore, and not only the name of the file itself. Thus, as soon as I deleted the path from the input field and kept the keystore name, it worked!

How I managed to misunderstand this is hard to fathom, but that’s the reality, haha.

Thanks for your assistance :slight_smile:

Greetings,

Okay, so I was having an issue just like this and here is how I fixed it.

First step, under project settings find Android-SDK and make sure you have everything set up. References to how to set them up and get their path can be found around online

Then copy the location of your JAVA(jdk) from the Android SDK settings, open up cmd, then type cd then paste the location of the JAVA you copied.

After that, paste code for the keystore generation (keytool -genkey -v -keystore ExampleKey.keystore -alias [YOUR NAME] -keyalg RSA -keysize 2048 -validity 10000) in the directory and set alias [YOUR NAME] to whatever you like but remember it.
You fill up any of the questions asked and the password.

After generating the file go to the directory (the JAVA directory we copied) where the file was created with your file explorer you will find the keystore here there. Copy or cut the keystore from that location and go to your Unreal project location, find Build folder, then Android folder, then you paste the file here

4

Now go back to unreal engine, open up the project settings, proceed to Android, then scroll to Distribution signing and fill in the fields appropriately
-Key store is the name of the file generated and add the .keystore behind it
-Key alias is the alias you inputted when generating the file ([YOUR NAME])
-Key password is the password you entered when generating the file as well
then rebuid you project.

NB: In my last two screenshots you will notice my keystore had the extension .jks instead of .keystore. I tried them both and they worked fine for me and this can be changed in the generation code: keytool -genkey -v -keystore ExampleKey.keystore -alias [YOUR NAME] -keyalg RSA -keysize 2048 -validity 10000.
You might also want to delete your Binaries, DerivedDataCache, Intermediate and Saved folder before rebuilding as it is known to save older build configs.