How do I compile Andor's Trail from source?

Discussions of the development process of the game.
Post Reply
Miuzu
Posts: 1
Joined: Sat May 21, 2022 7:33 am
android_version: 4.4 - Kitkat

How do I compile Andor's Trail from source?

Post by Miuzu »

Really sorry for the noob question, but I've been struggling for hours trying to find out how.

I've decided to clone the source code, edit some values to make my experience a bit better and I really cannot find a way how to compile it into a .apk file.

I've tried using android-studio and I got emulator working, but I didn't find a way to compile, as it gave me a "no runner" error. Using the files in travis directory didn't really help either since it seems the scripts there are made for debian, and I use arch.

Any help?
User avatar
Nut
Posts: 1096
Joined: Mon Oct 27, 2014 12:14 pm
android_version: 8.0
Location: Glade

Re: How do I compile Andor's Trail from source?

Post by Nut »

Hi Miuzu, welcome to our forum!

good that you asked, because you would have struggled still for days or weeks, because you must know a few things about the compile.

First thing is that the base of the engine is rather old. It is not possible to compile it with actual AndroidStudio versions.
(We don't have anybody in the dev team at the moment who is willing and capable to modernize the engine so that it works with actual AndroidStudio versions. I myself use AndroidStudio 2.2.2 and never updated it)
You would best use rijackson741's saved version: https://www.dropbox.com/s/cy924oqpaori5 ... s.exe?dl=0

Get the official and actual Andors-Trail sources from https://github.com/AndorsTrailRelease/andors-trail.

When you import the project, AndroidStudio will offer to migrate it to Gradle. DON'T do that, it won't work afterwards.

Then you can try to build the APK and get it running. Best use the "Run" option, so that AndroidStudio will compile it first and then launch it.
(I myself use an old phone via USB as target. It must have been prepared for debugging before you can do it.
But you can also use a virtual device on your PC)
Nut
_____
Moppl *, Conina Lvl 46, Lara: Lvl 49, Anwyn: Lvl 52, Nut: Lvl 61
Raphi
Posts: 24
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: How do I compile Andor's Trail from source?

Post by Raphi »

Hey, I am currently also trying to get Android Studio working for myself and I can't figure out how to. So far I got everything imported from GitHub and also set up an AVD. But to get the actual Run-button to work I have to select a Run/Debug Configuration. Which one do I have to choose there? I thought of Android App but when I select said, I can't select a Module in order to get it to work. So I guess that's not the right one? Hope somebody can help me there.
Lvl: 68, XP: 5705044, Gold: 104341, RoLS: 1
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
Aal_LP
Posts: 5
Joined: Tue Aug 08, 2017 7:19 am
android_version: 13 - Android 13

Re: How do I compile Andor's Trail from source?

Post by Aal_LP »

With the current release it has gotten quite easy:
  1. get the project from git (https://github.com/AndorsTrailRelease/andors-trail.git)
  2. install Android Studio (the latest version should work fine, I'm currently using Android Studio Dolphin | 2021.3.1 Patch 1)
  3. open Android studio and click 'Open', select the Folder 'AndrosTrail' inside the cloned git repository (there should be an 'app' folder and some '.gradle' files in it)
  4. after that there should be a run button if you have a Device to start it on (Virtual or Physical connected)
Note:
If it throws an error about a JDK version or something about java or anything like that, go to the Settings -> 'Build, Execution, Deployment' -> 'Build Tools' -> 'Gradle'. Try changing the option 'Gradle JDK' to something like 11 if its set to 1.8 or not valid at all.
Raphi
Posts: 24
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: How do I compile Andor's Trail from source?

Post by Raphi »

Ah I see, I think my mistake was that I directly imported all files from GitHub, including the folders AndorstrailEdit etc. as well. I have opened the right directory now, but it's still not working as it should be. The run button is still grayed out because of the missing run/debug config. When selecting Android App as such, it still tells me that the required module is missing, which I cannot select since there is only <no module> to select.

Also, when I opened up this new project, it threw two errors right away, one because of non-ascii chars in my file path (thats my fault) and the other says Failed to apply plugin 'com.android.internal.application'. I don't know if this causes any restrictions or further errors, so I would have ignored that for now. Mabye it has something to do with the run button not working, idk.

How my toolbar currently looks with the grayed out run button:
Note: The Nexus Phone thats selected as AVD shouldn't cause any problems, I've tried it with a newer AVD as well, a Pixel 4 with API 33.
You do not have the required permissions to view the files attached to this post.
Lvl: 68, XP: 5705044, Gold: 104341, RoLS: 1
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
Aal_LP
Posts: 5
Joined: Tue Aug 08, 2017 7:19 am
android_version: 13 - Android 13

Re: How do I compile Andor's Trail from source?

Post by Aal_LP »

Thats weird. I think the module should be there. Can you open the 'Gradle Scripts' Foldout at the bottom of your screenshot and tell me if there are two 'build.gradle' files, something simmilar like this:
Screenshot 2022-11-26 144716.png
If not something is missing. Maybe check if you are on the latest version from github, or maybe switch to this branch: https://github.com/AndorsTrailRelease/a ... ree/V0.8.4
You do not have the required permissions to view the files attached to this post.
Raphi
Posts: 24
Joined: Thu Sep 21, 2017 8:19 pm
android_version: 11 - Android 11
Contact:

Re: How do I compile Andor's Trail from source?

Post by Raphi »

Hey, sorry for the late answer, didn't get to do anything with it the last couple of days.

For me, there is only one of those files:
You do not have the required permissions to view the files attached to this post.
Lvl: 68, XP: 5705044, Gold: 104341, RoLS: 1
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
Post Reply