mnemosyne-proj / mnemosyne

Mnemosyne: efficient learning with powerful digital flash-cards.

Home Page:https://mnemosyne-proj.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building the android code in the current codebase is broken

acezalba opened this issue · comments

I am currently trying to build the Android app from the codebase. However, I am currently encountering some issues:

  1. Missing 'export.h' that causes the build to fail. This is an easy fix by adding the export.h header file from the p4a build. I have already coded a patch for this, which automates the transfer of necessary p4a headers and libraries via make commands.

  2. However, the reason why I can't create a pull request for the patch just yet is that I am currently encountering an issue getting the app to actually run in both my Android device and emulators.

The android app in Google Play Store behaves as expected I think. The app that is built from the current codebase is the one currently misbehaving.

Update: fixed the above crash. I was using the wrong syntax for zipping the stdlib.zip.

However I am not yet done. I am currently stumbling upon bootstrap.py not detecting the mnemosyne modules.

I fixed the above error by downgrading my current working version to Python3.9.

Apparently there's a reason why Python3.9 was hardcoded into the original make android command. Python versions 3.10 and above seems to silently break the compiled output of compile_zip.py. The original make android command is also hardcoded to use a Python binary in Windows. That did not help. In trying to automate the p4a integrations I had to un-hardcode the python version in the android command of the makefile. That's where this stage of the debugging process came to happen.

It does not help that there appears to be multiple versions of Python being involved in building this software. Minimum 3.5 in the documentation, Python3.9 and Python3.10 in README.devel for the android client, and Python3.9 and Python3.11 in the makefile.

As of this moment, I would say that Python3.9 is the strict minimum python version (or the strict python version) for this project for purposes of consistency.

p4a works seamlessly so far under Python3.9, and it is easy to bump p4a for python3.11 while locking the python version for the android client to be Python3.9.

However, until the cause of why Python3.9 is strictly necessary for compile_zip.py to compile as expected is discovered, using versions above Python3.9 for developing the Android client is not recommended.

I am however not yet done. At the moment, my Android app is currently crashing on touching the topbar.

As the Android client runs on my working thread as expected on an emulator (though still buggy), I will be closing this issue thread. Patches to follow soon. I recommend to use Python3.9 throughout the project until compile_zip.py is modified to run properly with higher Python versions. Then let's maintain a steady minimum Python version for development, only upgrading the minimum Python version when there is good reason to do so.

You did look at the Android specific development readme, I guess? Anyway, I'm happy to accept documentation patches to make it clearer that a specific Python version is needed. But as you say, for Android I'd only change binary dependencies, ABI level,.. when absolutely required. It's a lot of work for hardly any gain...

Well about that work. I've abstracted all that work into a single set of commands. It proved to be useful though.😅