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?
v0.8.10 (BWM fill) released to Google Play!
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.10) from Google, F-Droid, our server, or itch.io
Useful links
Source code of the game - Contribution guide - ATCS Editor - Translate the game on Weblate - Example walkthrough - Andor's Trail Directory - Join the Discord
Get the game (v0.8.10) from Google, F-Droid, our server, or itch.io
How do I compile Andor's Trail from source?
-
- Posts: 1
- Joined: Sat May 21, 2022 7:33 am
- android_version: 4.4 - Kitkat
- Nut
- Posts: 1531
- Joined: Mon Oct 27, 2014 12:14 pm
- android_version: 8.0
- Location: Glade
Re: How do I compile Andor's Trail from source?
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)
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
-
- Posts: 69
- Joined: Thu Sep 21, 2017 8:19 pm
- android_version: 11 - Android 11
- Contact:
Re: How do I compile Andor's Trail from source?
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
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
-
- Posts: 14
- Joined: Tue Aug 08, 2017 7:19 am
- android_version: 13 - Android 13
Re: How do I compile Andor's Trail from source?
With the current release it has gotten quite easy:
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.
- get the project from git (https://github.com/AndorsTrailRelease/andors-trail.git)
- install Android Studio (the latest version should work fine, I'm currently using Android Studio Dolphin | 2021.3.1 Patch 1)
- 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)
- after that there should be a run button if you have a Device to start it on (Virtual or Physical connected)
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.
-
- Posts: 69
- Joined: Thu Sep 21, 2017 8:19 pm
- android_version: 11 - Android 11
- Contact:
Re: How do I compile Andor's Trail from source?
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.
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
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
-
- Posts: 14
- Joined: Tue Aug 08, 2017 7:19 am
- android_version: 13 - Android 13
Re: How do I compile Andor's Trail from source?
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:https://github.com/AndorsTrailRelease/a ... ree/V0.8.4
If not something is missing. Maybe check if you are on the latest version from github, or maybe switch to this branch: You do not have the required permissions to view the files attached to this post.
-
- Posts: 69
- Joined: Thu Sep 21, 2017 8:19 pm
- android_version: 11 - Android 11
- Contact:
Re: How do I compile Andor's Trail from source?
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:
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
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
-
- Posts: 14
- Joined: Tue Aug 08, 2017 7:19 am
- android_version: 13 - Android 13
Re: How do I compile Andor's Trail from source?
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)
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)
-
- Posts: 69
- Joined: Thu Sep 21, 2017 8:19 pm
- android_version: 11 - Android 11
- Contact:
Re: How do I compile Andor's Trail from source?
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 ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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.
Lvl: 68, XP: 5705044, Gold: 104341, RoLS: 1
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
Hp: 244, AC: 282, AD: 20-31, BC: 157, DR: 6
- Nut
- Posts: 1531
- Joined: Mon Oct 27, 2014 12:14 pm
- android_version: 8.0
- Location: Glade
Re: How do I compile Andor's Trail from source?
Congratulation!
Or make it https.
I thought we had fixed all of these by now. Where did you get the source from exactly?
Or make it https.
I thought we had fixed all of these by now. Where did you get the source from exactly?
Nut