Skip to content
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

dlopen failed: cannot locate symbol "_Py_NoneStruct" #887

Closed
ZingBallyhoo opened this issue Sep 18, 2016 · 16 comments
Closed

dlopen failed: cannot locate symbol "_Py_NoneStruct" #887

ZingBallyhoo opened this issue Sep 18, 2016 · 16 comments

Comments

@ZingBallyhoo
Copy link
Contributor

Built using Lubuntu 14.04 with CrystaX NDK 10.3.2 (python3crystax)

The APK is located here

The project's repository

The file being built

Seems to be very much similar to #859

Here is the log:

I/python (22857): [INFO ] [Logger ] Record log in /data/data/org.kivymd.kitchensink/files/app/.kivy/logs/kivy_16-09-18_1.txt
I/python (22857): [INFO ] [Kivy ] v1.9.2-dev0
I/python (22857): [INFO ] [Python ] v3.5.0 (default, Dec 24 2015, 05:56:40)
I/python (22857): [GCC 5.3 20151204]
I/python (22857): Traceback (most recent call last):
I/python (22857): File "main.py", line 2, in
I/python (22857): import kivymd.snackbar as Snackbar
I/python (22857): File "./kivymd/snackbar.py", line 3, in
I/python (22857): from kivy.animation import Animation
I/python (22857): File "/data/data/org.kivymd.kitchensink/files/app/crystax_python/site-packages/kivy/animation.py", line 87, in
I/python (22857): from kivy.event import EventDispatcher
I/python (22857): File "/data/data/org.kivymd.kitchensink/files/app/crystax_python/site-packages/kivy/event.py", line 8, in
I/python (22857): import kivy._event
I/python (22857): ImportError: dlopen failed: cannot locate symbol "_Py_NoneStruct" referenced by "_event.so"

Thanks

@inclement
Copy link
Member

Are you using an up to date p4a? I fixed a bug relating to this very recently? Make sure you're using either the stable release from pypi or the latest master.

@ZingBallyhoo
Copy link
Contributor Author

@inclement Forgot to mention it is being built via buildozer, and it is cloning the master branch for me.

@inclement
Copy link
Member

You specifically cleared the buildozer cache (or only ran it for the firt time recently)?

@ZingBallyhoo
Copy link
Contributor Author

ZingBallyhoo commented Sep 18, 2016

@inclement Yep, when I run into issues (with building) I always run "buildozer android_new clean" and then build again.

@inclement
Copy link
Member

I assume the clean command definitely deletes p4a?

Would you be able to try building with the same parameters using python2 instead of python3crystax? Just to check if the same thing happens.

@KeyWeeUsr
Copy link
Contributor

Same/similar to this

p4a master, kivy master, pygame bootstrap, launcher building

[INFO   ] Logger: Record log in /storage/emulated/0/kivy/showcase/.kivy/logs/kivy_16-09-15_2.txt
[INFO   ] Kivy: v1.9.2-dev0
[INFO   ] Python: v2.7.2 (default, Sep 15 2016, 15:16:44) 
[GCC 4.6 20120106 (prerelease)]
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "main.py", line 29, in <module>
[WARNING] stderr:     from kivy.app import App
[WARNING] stderr:   File "/home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/kivy/app.py", line 319, in <module>
[WARNING] stderr:   File "/home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/kivy/base.py", line 29, in <module>
[WARNING] stderr:   File "/home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/private/lib/python2.7/site-packages/kivy/clock.py", line 364, in <module>
[WARNING] stderr: ImportError: dlopen failed: "/data/data/org.kwu.launcher/files/lib/python2.7/site-packages/kivy/_clock.so" is too small to be an ELF executable

@inclement
Copy link
Member

@KeyWeeUsr I think this one is more likely related to a different issue (arising from my fix for something else) affecting only the pygame bootstrap. It's not completely unrelated though.

@ZingBallyhoo
Copy link
Contributor Author

ZingBallyhoo commented Sep 18, 2016

@inclement Just building and will get back to you soon, last time I tested (with python2) it worked mostly fine, except an issue about not being to find and import the module kivymd.vendor.circulartimepicker even though all other kivymd modules worked fine.

@ZingBallyhoo
Copy link
Contributor Author

@inclement I'm getting a different error now (when building). Its possibly because I'm still using the CrystaX NDK? Or is that OK?

Here is the error

[INFO]: Copying hostpython binary to targetpython folder
[INFO]: -> running cp /home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/build/build/other_builds/hostpython2/des...(and 144 more)
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in run_code
exec code in run_globals
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 798, in
main()
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 795, in main
ToolchainCL()
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 470, in init
getattr(self, args.subparser_name.replace('-', '
'))(args)
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 146, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/toolchain.py", line 189, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "pythonforandroid/build.py", line 561, in build_recipes
recipe.build_arch(arch)
File "/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/python2/init.py", line 53, in build_arch
join(self.ctx.get_python_install_dir(), 'bin', 'python.host'))
File "pythonforandroid/logger.py", line 173, in shprint
for line in output:
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 565, in next
self.wait()
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 500, in wait
self.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 516, in handle_command_exit_code
raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1

Command failed: python -m pythonforandroid.toolchain --color=always --storage-dir=/home/kivy/Desktop/kivymd/KivyMD/.buildozer/android/platform/build create --dist_name=kitchensink --bootstrap=sdl2 --requirements=python2,kivy==master,git+https://gitlab.com/kivymd/KivyMD.git --arch armeabi-v7a --copy-libs

@inclement
Copy link
Member

Using CrystaX should still be fine (I use it for everything), but not sure what this error is.

I'll be going through all the builds to check some things next time I get a chance (following the recent problems introduced a while ago and only semi-fixed), so hopefully I can address these problems then.

@ZingBallyhoo
Copy link
Contributor Author

@inclement I just got the Python 2 build to work again, after clearing Buildozer a few times, and the APK runs without crashing (well sorta, there is still one issue with my non kivy code). This issue only occurs when I build Python3

@pomarec
Copy link

pomarec commented Jan 9, 2017

Same error here :

  • Crystax 10.3.2
  • Kivy 1.9.2-dev0
  • Python 3.5.0 (virtualenv & pyenv)
  • Mac OS X El Capitain (10.11.6)

I'm ready to dig and propose a PR, I have python knowledge, some linux as well but I definitely need guidance on where to dig :)

@pomarec
Copy link

pomarec commented Feb 10, 2017

Does someone has any advice on how to attack the problem ?

@artwyman
Copy link

I'm seeing the original error (cannot locate symbol "_Py_NoneStruct") too using Python 3 and CrystaX. My p4a build is the latest from pip. @inclement @pomarec any updates on this?

@tito
Copy link
Member

tito commented Mar 5, 2017

I got the exact same issue using python-for-android via pip install.
By using latest master, it works:

git clone https://github.com/kivy/python-for-android
cd python-for-android
python setup.py develop

Then clean everything and restart:

p4a clean_builds
p4a clean_dists

@tito tito closed this as completed Mar 5, 2017
@inclement
Copy link
Member

For reference, I think this is probably fixed by ed1e1a8, although I wasn't sure at the time as I added it in response to a slightly different error. Glad it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants