How to compile MT for Android usage?

Post Reply
User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

How to compile MT for Android usage?

by Andrey01 » Post

I know how to do it on Linux, but on Android I need to get apk file and I don't know how to. And it's wondering there's nothing said about compiling on that OS in README.md.

ldmoretti
New member
Posts: 2
Joined: Thu Sep 26, 2019 17:36

Re: How to compile MT for Android usage?

by ldmoretti » Post

I'm also trying to compile for Android. So far I've spent several hours banging my head against it with no luck.

User avatar
archfan7411
Member
Posts: 15
Joined: Wed Sep 26, 2018 00:37
GitHub: archfan7411
In-game: archfan

Re: How to compile MT for Android usage?

by archfan7411 » Post

I've found https://dev.minetest.net/Android, which might be outdated (considering the state of the rest of the dev wiki) but should hopefully provide a starting point.

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

I spent 2 weeks without any success on it.

According to the documentation:
Required packages
Git, Make, and other basic tools are necessary:

What are basic tools?
Could someone provide an advise about the ubuntu version, sdk version, ndk version, "basic tools" (what is it?), please.

I spent 2 weeks without any success on it.

According to the documentation:
Required packages
Git, Make, and other basic tools are necessary:

What are basic tools?
Could someone provide an advise about the ubuntu version, sdk version, ndk version, "basic tools" (what is it?), please.

I tried to build the master or stable version - doesn't metter. All atempts are not successull.

ftl
New member
Posts: 7
Joined: Mon Nov 04, 2019 02:26
GitHub: FullTimeLinux
In-game: ftl

Re: How to compile MT for Android usage?

by ftl » Post

Andrey01 wrote:I know how to do it on Linux, but on Android I need to get apk file and I don't know how to. And it's wondering there's nothing said about compiling on that OS in README.md.
I think the only tools you'll need is git, make, gradle, the lib32z1 package if you're computer uses 64 bit, and a folder ~/Documents/myMineTestFolder/build/android/

Otherwise I don't see what else you need either. What steps did your computer fail on? That question can be answered by everyone on this thread.

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

Hello,
Thank for your response.

Do you have any suggestions for Linux Distributive to be used for it?
If you able to compile Android build on your own - could you share please the version of sdk, ndk?

Today I plan to start from scratch and collect specific errors that I have.

I am a .net developer and I promise no to ask stupid questions, but I definitely need help to compile MT for android, please.

tashbaugh
Member
Posts: 25
Joined: Tue Jan 15, 2019 18:25
GitHub: ashbaught
Location: Alabama - US
Contact:

Re: How to compile MT for Android usage?

by tashbaugh » Post

I too desperately need to compile my own Android APK. I've spent 3 days trying to compile using the instructions here: https://dev.minetest.net/Android -- to no avail. I built a Virtual Box running Ubuntu Desktop 18.04 and installed all of the prerequisites.
No matter what I do, I receive the following error:

Code: Select all

Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.    
make[2]: Entering directory `/home/ashbaught/minetest/build/android'
[armeabi-v7a] SharedLibrary  : libminetest.so
jni/../jni/src/gui/guiFormSpecMenu.cpp:1451: error: undefined reference to 'GUIHyperText::GUIHyperText(wchar_t const*, irr::gui::IGUIEnvironment*, irr::gui::IGUIElement*, int, irr::core::rect<int> const&, Client*, ISimpleTextureSource*)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [obj/local/armeabi-v7a/libminetest.so] Error 1
make[2]: Leaving directory `/home/ashbaught/minetest/build/android'
Makefile:687: recipe for target 'apk' failed
make[1]: *** [apk] Error 1
make[1]: Leaving directory '/home/ashbaught/minetest/build/android'
Makefile:156: recipe for target 'release' failed
make: *** [release] Error 2
I've tried using the version of SDK and NDK listed in the documentation on https://dev.minetest.net/Android, as well as the latest versions. Also, this forum comment viewtopic.php?f=42&t=21526&start=25 -- indicates that I should "replace ndk-r16b with ndk-r17c", which I have also tried without success.

Has anyone successfully compiled an APK lately? Our School District has nearly 10000 students, and we use Minetest as an incentive/rewards program to encourage students to read more books so that they receive in-game content & play time. Unfortunately, we need to compile our own APK so that we can use our custom main menu to restrict students to our multi-server universe. Additionally, we've had to modify some of the built-in lua files to accomodate cross-server player logins for instances & multiple worlds. (To load balance the huge number of players we support accross many .exe threads so that things don't get too laggy when many students are logged in)

Long story short, I need help compiling an APK.

And, on a different note, I desperately need to compile a win64 version that has PostgreSQL support. Currently, I'm writing player health/hunger/breath/inventory items to a mySQL table when transferring them between server instances, and it would be much easier if I could have all server instances using the PostgreSQL backend for player files, instead of the sqlite db.

As a systems administrator, my skill set is such that I can follow basic instructions to compile code if I need to, but, without detailed instructions, I lack the programming experience to read between the lines of vague/outdated instructions.

I'd be happy to provide dependency version information or detailed compile logs to anyone willing to be of assistance in this matter.

Thank you.
Lee County Schools uses Minetest to promote student reading. https://mine.lee.k12.al.us

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

Hello tashbaugh,
Right now I have the same problem.

I tried different versions of sdk, nkd, etc.
I tried to build using Ubuntu, Debian - in all cases I see the same error.
Also, I tried to build the stable-5 branch, but also receiving the same error.

Please, let me know if you would be able to fix it and compile android MT apk.

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How to compile MT for Android usage?

by Linuxdirk » Post

tashbaugh wrote:I've spent 3 days trying to compile using the instructions here: https://dev.minetest.net/Android -- to no avail.
Most distributions have the Android APK available in their official repositories or user-contributed repositories.

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

The question is how to compile it, but not where to obtain compiled APK.
Because the README is outdated and not valid.

tashbaugh
Member
Posts: 25
Joined: Tue Jan 15, 2019 18:25
GitHub: ashbaught
Location: Alabama - US
Contact:

Re: How to compile MT for Android usage?

by tashbaugh » Post

Linuxdirk wrote:
tashbaugh wrote:I've spent 3 days trying to compile using the instructions here: https://dev.minetest.net/Android -- to no avail.
Most distributions have the Android APK available in their official repositories or user-contributed repositories.
Unfortunately, I need to have a slightly modified version of Minetest that uses our custom main menu. Due to internet safety concerns, we must prevent our students from playing online with strangers. We restrict them to only connecting to our servers that we host in-house. Additionally, I've modified some of the built-in lua files to support seamless teleportation between servers. Regular distributions no longer work for our growing server environment

Hopefully one of the developers of the distributions/repositories that you mentioned will be able to shed some light on why the rest of us are unable to compile an APK from source.

Thank you for your attention to this matter.
Lee County Schools uses Minetest to promote student reading. https://mine.lee.k12.al.us

ftl
New member
Posts: 7
Joined: Mon Nov 04, 2019 02:26
GitHub: FullTimeLinux
In-game: ftl

Re: How to compile MT for Android usage?

by ftl » Post

@tashbaugh
The apk developer you may want to contact is MoNTE48 on github. Judging from pull request 9066 and 9089 the android version is about to get a major revamp.

Were you sucessful at all at making minetest-4-stabe, minetest-5-stable or minetest-5.1-stable before editing the gui source code? Or did you have more luck with 0.4.17.21 vs 0.4.16? I'd like to know the points where you suceded before we go any further. Here's a list of some sucessful apk releases distributed to f-droid if that helps https://fdroid.org/wiki/page/net.minetest.minetest . I installed Ubuntu 18.04 on bare metal and when I made it, I got libicov erros which I think MoNTE48's two pull requests should resolve. I'll keep hacking away at it this weekend.
tashbaugh wrote:And, on a different note, I desperately need to compile a win64 version that has PostgreSQL support
I'm probably not the guy to help you with that as I know nothing about PostgreSQL and am finishing up a SQLlite database class in school.

I'm also going through and documenting my experience through making this apk so we can have updated information on the wiki.

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

Hello Everyone,
I was able to compile MT for Android from the Source using fixes from this PR: https://github.com/minetest/minetest/pull/9089

MoNTE48, THANK YOU FOR YOUR EFFORT, I appreciate it!

urben
New member
Posts: 8
Joined: Sat Nov 02, 2019 18:23

Re: How to compile MT for Android usage?

by urben » Post

Hello Everyone,
I was able to compile MT for Android from the Source using fixes from this PR: https://github.com/minetest/minetest/pull/9089

MoNTE48, THANK YOU FOR YOUR EFFORT, I appreciate it!

tashbaugh
Member
Posts: 25
Joined: Tue Jan 15, 2019 18:25
GitHub: ashbaught
Location: Alabama - US
Contact:

Re: How to compile MT for Android usage?

by tashbaugh » Post

urben wrote:Hello Everyone,
I was able to compile MT for Android from the Source using fixes from this PR: https://github.com/minetest/minetest/pull/9089

MoNTE48, THANK YOU FOR YOUR EFFORT, I appreciate it!
I see that MoNTE48's PR 9089 is for the stable-5 branch. I deleted my minetest directory that I was working from and started over with this command:

Code: Select all

git clone -b stable-5 --single-branch --depth 1 https://github.com/minetest/minetest.git
Did I do that correctly?

I couldn't figure out how to apply the changes from the PR using git. I'm sorry, much of this is all new to me. I manually edited each of the files to match the changes from the PR.

BEHOLD:

Code: Select all

BUILD SUCCESSFUL in 1m 9s
26 actionable tasks: 26 executed
APK stored at: build/outputs/apk/release/Minetest-release.apk
Thank you everyone involved! (MoNTE48, urben, nerzhul)

I can't wait until I can do this with a 5.2.0 instead of stable-5! I may have to back my server down to 5.1.0 so that I can support our Chromebooks thru Android.
Lee County Schools uses Minetest to promote student reading. https://mine.lee.k12.al.us

tashbaugh
Member
Posts: 25
Joined: Tue Jan 15, 2019 18:25
GitHub: ashbaught
Location: Alabama - US
Contact:

Re: How to compile MT for Android usage?

by tashbaugh » Post

@ftl
ftl wrote:The apk developer you may want to contact is MoNTE48 on github. Judging from pull request 9066 and 9089 the android version is about to get a major revamp.
Thank you for pointing everyone in the right direction. MoNTE48's Pull Requests were just what we needed.
ftl wrote: Were you sucessful at all at making minetest-4-stabe, minetest-5-stable or minetest-5.1-stable before editing the gui source code? Or did you have more luck with 0.4.17.21 vs 0.4.16? I'd like to know the points where you suceded before we go any further.
I just today learned how to "git" from different branches. Most of that was beyond my skill set a few hours ago.

As for the PostgreSQL support for Windows, --no worries. I'll put that one on the back-burner while I focus on getting out Chromebooks running the Android version.
ftl wrote: I'm also going through and documenting my experience through making this apk so we can have updated information on the wiki.
Good on You! https://dev.minetest.net/Android may need to be updated.
Thanks!
Lee County Schools uses Minetest to promote student reading. https://mine.lee.k12.al.us

ftl
New member
Posts: 7
Joined: Mon Nov 04, 2019 02:26
GitHub: FullTimeLinux
In-game: ftl

Re: How to compile MT for Android usage?

by ftl » Post

I'm glad I could help out everyone!

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests