Hi everyone.
In my application I've implemented a pyobdc module to make querys to a MSSQL database, it works fine in my Linux Machine but when I compile it with buildozer to create the APK something goes wrong.
I realized that there is not a p4a recipe for this module so made a Fork of the python-for-android repository and created my own. This is the code of the __init__.py file that is inside the folder named pyobdc in the recipes directory:
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
class PyodbcRecipe(CompiledComponentsPythonRecipe):
version = '4.0.30'
url = 'https://github.com/mkleehammer/pyodbc/archive/{version}.tar.gz'
site_packages_name = 'pyodbc'
depends = ['setuptools']
call_hostpython_via_targetpython = False
install_in_hostpython = False
install_in_targetpython = False
recipe = PyodbcRecipe()
Included with this, I modified the . spec file to call this Fork.
p4a.fork = drarn96
p4a.branch = develop
Now the compiler has recognized pyodbc as one of his own recipies.
At this point That is all what I know, that the recipe is being recognized, however I don't know if it is being created in the right way
I’m just sure of version, url and site_packages_name values, otherwise, I don’t know anything.
The actual error that I have is this:
/home/linuxlite/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/local/lib/libodbc.so while searching for odbc
/home/linuxlite/.buildozer/android/platform/android-ndk-r19c/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lodbc clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/ccache' failed with exit status 1
It seems that pyobdc need a better configuration in the recipe class, because it's not finding an obdc. Maybe a driver has to be configured inside it, I don't know. I will be very thankful if I can get some advice, information of any kind or corrections because I've been reading the documentation and seeing how other recipes works but is not clear for me at all.