Android Build

Started by Vincent, Tue 10/01/2023 13:30:59

Previous topic - Next topic

Vincent

Hello I am trying for the first time to build a game for Android. I am stuck at the "key store path" and I dont know what I should do exactly.


Khris

#1
Pick any or create a folder, like D:\Projects\. Then select that folder using the browse button.
Finally, add "keystore.jks" to the path.
Like in the above example, it should eventually say this in the field:

D:\Projects\keystore.jks

The Android SDK will use this path to create a keystore file.
You can think of it like a "Save As..." path of a newly created file.

Vincent

Thanks Khris, I did what you said but it show two errors, maybe I am doing something wrong:
The first sentence say that the value can't be null.




eri0o

#3
@Vincent , first, yes this should not crash but report a proper error, but I don't know what exactly is going on so lets check things together here to figure out what is going on.

First thing, to run this, AGS will need some tools to be installed

Have you followed the steps here?

https://adventuregamestudio.github.io/ags-manual/BuildAndroid.html#building-for-android

In the Editor Preferences, the Android preferences there, if I remember correctly, ANDROID_HOME and JAVA_HOME will report a "Found on Config!" message directly in the preferences if they are correct. I need this to find the tool that is used to create the keys.

Spoiler
[close]

https://adventuregamestudio.github.io/ags-manual/EditorPreferences.html#android

Vincent

#4
@eri0o thanks for answering, I've been following the manual and installed all the tools required. When I go to the Editor Preferences I left ANDROID_HOME and JAVA_HOME to be default (as you can see in the first screenshot) is that wrong? I had to choose a path or can I leave them to be default? Also suddenly when I click 'generate keystore' I dont get any message and it show that menu you see in the screenshot which I should fill the keystore path. I created a folder for that path but it just allow me to select a .jks file which I dont know where I should get it.

Khris

To clarify, you're supposed to generate the keystore file if you don't already have one. This is what the "Generate keystore" button and that dialog are for. Once you have a keystore file, you can re-use if for all future Android projects, inside or outside of AGS.

I'm not sure why AGS would try and combine the path for the keystore file from two strings in the first place tbh, but you can workaround this if you create the keystore file outside AGS, then simply select it in the Android preferences pane.

eri0o

#6
@Vincent does the "Found On Config!" prompts next to these variable names appears in your install, like in the image above?

To use the default you have to set those environment variables in Windows itself, as it needs the environment variables to load that. (you can check this by loading cmd.exe and typing echo %JAVA_HOME% )

The screenshot I am interested is the Editor Preferences but the keystore generating window is obscuring that. I will block that button until the other variables are set correctly.

Vincent

Guys thanks for answering, I'm trying to figure it out how all of this works, thanks for your patience. I think maybe something its missing. I've been trying to search for AppData/Local/JetBrains as it show in your screenshot but can't find any JetBrains. For SDK path I've been trying to follow your screenshot but can't see any "Found On Config!" on both side. In Android studio I've been installing Android 10.0 (Q) should I need anything else?



If I use the cmd.exe and type echo %JAVA_HOME% nothing seems to happen at all


eri0o

ok, let's roll back a bit, how did you install Android Studio? Are you using the JetBrain Toolbox or did you install by using a installer somewhere? Can you tell me from where you got it?


Also which version of Android Studio do you have?

Vincent

I downloaded Android Studio from this site which is the first one that pop up on google: https://developer.android.com/studio


Android Studio Dolphin | 2021.3.1 Patch 1
Build #AI-213.7172.25.2113.9123335, built on September 30, 2022
Runtime version: 11.0.13+0-b1751.21-8125866 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar=false



Is this all correct?

eri0o

#10
OK, so you got from Google. Now, I believe this one installs in Program Files, does the following directory exists in your computer?

C:\Program Files\Android\Android Studio\jre

(if that exists, that should be your JAVA_HOME, you can set it in Editor Preferences)

Vincent

Ok, now the "Found On Config!" it showed on the JDK path by following this: C:\Program Files\Android\Android Studio\jre

What about the SDK path?

eri0o

One thing at a time, let's figure out where that was installed.

First, the default location is usually

C:\Users\vincent\AppData\Local\Android\Sdk

Is it there?

Vincent

Yes C:\Users\Utente\AppData\Local\Android\Sdk is there

eri0o

Cool, so you can just use this directory there for the SDK path and a Found On Config! should appear.

In the previous message you sent here https://www.adventuregamestudio.co.uk/forums/index.php?topic=60517.msg636652579#msg636652579, on top of that window it should be a textbox that says SDK Path: and follows with a directory, so you can always check there in case you need or have installed in a different place.

Vincent

This is strange because I am using that path: C:\Users\Utente\AppData\Local\Android\Sdk but it doesn't show the "Found On Config!"


eri0o

#16
That's interesting, I need a fresh install of that version to check.

Google documentation says some things are in specific directories in their SDK, but at the time I made this, the documented locations were incorrect and I used what was true for my Android Studio installation at the time - I also checked previous versions and they matched.

My guess is they finally moved things to the correct place.

The incorrect place of the SDK Manager that was before, and where we look into in AGS Editor was in tools\bin\sdkmanager, inside the SDK directory.

@Vincent unfortunately, if this is the case, this means that I need to fix this before you can proceed.

Also, just checking, the correct path should be:
cmdline-tools/latest/bin/sdkmanager

Reference: https://developer.android.com/studio/command-line/sdkmanager

Inside the SDK directory.

The problem was that the SDK installed by Android Studio didn't used to have the SDK Manager there, only if you downloaded separately, but then it wouldn't work with Android Studio tools.

Vincent

#17
So if doesn't appear the "Found On Config!" for SDK path I can't try to build it right?

EDIT: ok no problem btw I can't find any of this inside the SDK directory "cmdline-tools/latest/bin/sdkmanager"

This is what I have inside the SDK folder:


eri0o

I think it won't work. I added some more information in my previous post, please read.

Also, just please, check that is indeed the SDK path that is pointed by Android Studio. The problem I had when making this feature is these weren't matching.

I copied the behavior from Game Maker: https://help.yoyogames.com/hc/en-us/articles/115001368727-Setting-Up-For-Android

eri0o

Quote from: Vincent on Tue 10/01/2023 15:49:37So if doesn't appear the "Found On Config!" for SDK path I can't try to build it right?

EDIT: ok no problem btw I can't find any of this inside the SDK directory "cmdline-tools/latest/bin/sdkmanager"

So Google invented a new place to put this that doesn't match their documentation. Awesome, I will check later what they did on this Android Studio version to match in the Editor.

SMF spam blocked by CleanTalk