Page 1 of 2

How do I compile Andor's Trail from source?

Posted: Sat May 21, 2022 8:42 am
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?

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

Posted: Sat May 21, 2022 9:32 am
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)

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

Posted: Sat Nov 19, 2022 5:34 pm
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.

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

Posted: Sun Nov 20, 2022 2:05 pm
by OMGeeky
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.

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

Posted: Mon Nov 21, 2022 11:16 am
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.

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

Posted: Sat Nov 26, 2022 1:50 pm
by OMGeeky
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

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

Posted: Sat Dec 03, 2022 10:38 pm
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:

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

Posted: Mon Dec 12, 2022 2:45 pm
by OMGeeky
Hmm, I think I know what the issue is,
Im just wondering how we could solve this for you and everyone else in the future.
Can you try cloning this branch of my fork and see if it works with that?
https://github.com/OMGeeky/andors-trail ... nore-fix-1

If you find anything unusual with that feel free to tell me (for example if any files are changed and would be checked into git just by opening and building it, that would probably not be good and should be excluded)

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

Posted: Sun Nov 26, 2023 12:46 pm
by Raphi
Alright, so after giving it another try yesterday I got it running actually (don't know what I did wrong last time). I could start the game on my AVD and everything worked fine. Now, after importing my own content to the folders /raw/ (json files) and /xml/ (tmx files) and typing everything into loadresources.xml, I got an Error on my map files saying that the "Resource compilation failed" because some markup declarations have to be properly formatted. I'm not really sure what this means and wondered if anyone could help me there. Seems like an easy to solve error if I'd knew what it was :D

Edit:
Alright, alright, as always shortly after you post about it, you come across the solution yourself.

So if anybody else got this issue: I had to remove the line

<!DOCTYPE map SYSTEM "http://mapeditor.org/dtd/1.0/map.dtd">

from every tmx map I created or altered. Then it worked.

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

Posted: Sun Nov 26, 2023 1:03 pm
by Nut
Congratulation!
Or make it https.
I thought we had fixed all of these by now. Where did you get the source from exactly?