Page 1 of 1

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 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.

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 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