-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need libpython3.7m.so.1.0 in android phone #1501
Comments
It seems like something with the linker options might have gone wrong, so it might be helpful to see the build. Could you enable p4a's |
@inclement could you take a look at this? This is something related to the new This is the
I suspect the Maybe this is an issue with the specific newer/older clang from this particular NDK version? |
I'm not sure exactly what is wrong here, but both libpython3.7m.so and libpython3.7m.so.1.0 should be present in the APK. I think it is expected that libpython3.7m.so relies on symbols loaded from libpython3.7m.so.1.0. I wondered if this would cause issues with linking when I first set this up, but forgot about it when it didn't appear to do so. I wonder, does this still happen if libpython3.7m.so.1.0 is loaded explicitly when the app is started, as we do for the other library files? I think this would require slightly more modification to PythonUtil.java than one might hope, because the Java method called to load the libraries automatically finds them and only supports a .so suffix (although I could be wrong about that). |
@inclement @Jonast You can reproduce this? (This error launch in phone)?
Also this error aviable, then I compile Hello World. This apk in phone start with error (see bottom message) :-( |
You can uncompress for sea this result apk |
I just checked, there is only |
Ah, quite interesting. I wonder at what point in the build process it failed to appear or be copied around. @homdx it looks like you are using p4a directly? What files are present in `~/.local/share/python-for-android/dists/$YOURDISTNAME/libs/armeabi-v7a? |
I can reproduce for you Docker file, if you need?) |
yes. I run with:
|
@homdx I just attempted to configure your exact build combination and see if compiling the kivy demo app will include Basically all I'm saying is I'll tell you if I can reproduce this as soon as I manage to actually get through the build 😆 hang in there |
@inclement I can confirm that Steps to reproduce manually:
Steps to reproduce in docker environment: (with my little experimental build environment tool)
This is the result when examining the .apk (note the missing
However, the
|
Wow, that's quite interesting. Am I right in thinking that you've successfully used the python3 recipe, so it isn't a generic problem that happens to everyone except me? |
@inclement the exact environment Edit: I don't know if it's a generic problem, because I haven't tried any other environment with the Please also note that |
@Jonast Thank you. You release very interesting tool p4a-build-spaces:
Now wait fix by @inclement for python |
while trying to build with Dockerfile.py3 - I have identical error msg. cmd within docker is
|
short investigation: gradle is guilty for such situation. Why? it's total mysterious tool for me, so I have no idea. However - so.1.0 exists in libs/ dir, but is absent in .apk |
The Java method called to load the libraries only supports a .so suffix, so we must remove the version for our python libraries, or we will get linkage errors Resolves: kivy#1501
Ok, I solved the linkage problem with libpython3.7.so.1.0, and @inclement was in the right direction:
So...there is no way that the java loader can load a versioned library...therefore... is no problem with gradle, is our build method what is causing the problems, but this can be easily solved by forcing that the python library gets built without the version, so this way we will have the proper suffix, and we will avoid all this linkage problems. The fix is already applied in pr #1537, but here I leave a link to a patch that will solve the problem for the current master branch: https://gist.github.com/opacam/10cef1ca8182a39b9e5ebffe0adcdc90#file-fix-python3-linkage-patch |
…NSTSONAME`) We fix this issue by re-introducing `INSTSONAME`. This variable has been used in all our python recipes, because allow us to remove the version of the compiled python library which is mandatory, at the time of writing, because android does not support versioned libraries (the Java method called to load the libraries only supports a .so suffix). A little history, because I didn't find any official documentation for this variable, and **it's quite important for us**: - This variable it's not hacked, it's official and was introduced a long time ago, forms part of the python's shared library building process (python/cpython@1142de3) - @tito introduced this variable almost at the beginning of the p4a project in (bdefea1) - @inclement also make use of it when he reworked the python2 recipe (4c8b5bc) - this variable still exists in the current python2 recipe and we make use of it precisely to solve the mentioned android's libraries version problem - Somehow, during the process of making the new python3 recipe, we loose this variable and then, we begin to have linkage problems at runtime with our python library as described in issue kivy#1501 Note: ¡¡¡Special thanks to @Jonast!!!...to force me to search this information ;) References: python/cpython@1142de3, bdefea1 and 4c8b5bc Resolves: kivy#1501
@opacam I comfimed. Now app are start in mobile phone without this error)
But I compile only with buildozer 0.37: api = 27, sdk=24, nkd 16b, |
@opacam Thank you! I pushed you patch for testing in branch fix/python37 |
My method consist in set the variable |
@opacam I think, need feature for p4a with path like p4a.source_dir in buildozer |
This option is commented in the default buildozers spec file...I suppose that you modified this file from a previous version of buildozers...so...if you don't find this option commented in your buildozers file just add it and put the corresponding path (look at almost the end of the section |
Guys, about this, previous Python 2.7 compilation was forcing INSTSONAME to be just libpython2.7.so, while now, none of the Python 2 and 3 recipes set it. The right fix is either set |
…STSONAME`) We fix this issue by re-introducing `INSTSONAME`. This variable has been used in all our python recipes, because allow us to remove the version of the compiled python library which is mandatory, at the time of writing, because android does not support versioned libraries (the Java method called to load the libraries only supports a .so suffix). A little history, because I didn't find any official documentation for this variable, and **it's quite important for us**: - This variable it's not hacked, it's official and was introduced a long time ago, forms part of the python's shared library building process (python/cpython@1142de3) - @tito introduced this variable almost at the beginning of the p4a project in (bdefea1) - @inclement also make use of it when he reworked the python2 recipe (4c8b5bc) - this variable still exists in the current python2 recipe and we make use of it precisely to solve the mentioned android's libraries version problem - Somehow, during the process of making the new python3 recipe, we loose this variable and then, we begin to have linkage problems at runtime with our python library as described in issue kivy#1501 Note: ¡¡¡Special thanks to @Jonast!!!...to force me to search this information ;) References: python/cpython@1142de3, bdefea1 and 4c8b5bc Resolves: kivy#1501
Merged #1568. Please test with the current master if the error is still present. |
Hello.
I build with this instruction:
https://groups.google.com/forum/#!topic/kivy-users/Lf4zlYmLVPo
Apk compiled and builded. After setup and launch in my Android phone, I have a error:
The text was updated successfully, but these errors were encountered: