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

Using pyjnius leads to crash (sometimes?) if app built by new toolchain #959

Closed
germn opened this issue Dec 16, 2016 · 2 comments
Closed

Comments

@germn
Copy link
Contributor

germn commented Dec 16, 2016

There's no crash message in logs, but we'll see this lines while app initialization:

[ERROR ] Input: AndroidJoystick is not supported by your version of linux

Traceback (most recent call last):

File "/home/kivy/test/.buildozer/android/platform/build/dists/test/private/lib/python2.7/site-packages/kivy/input/providers/__init__.py", line 57, in <module>

File "/home/kivy/test/.buildozer/android/platform/build/dists/test/private/lib/python2.7/site-packages/kivy/input/providers/androidjoystick.py", line 20, in <module>

Exception: android lib not found.

and

[WARNING] Base: Unknown <android> provider

Here's full typical log.

Problem was originally discovered here, but affects also Python 2.7 builds with Android NDK.

There's no such problem with old toolchain.

@germn germn changed the title Using pyjnius leads to crash if app built in Ubuntu/Debian by new toolchain Using pyjnius leads to crash (sometimes?) if app built by new toolchain Dec 17, 2016
@germn
Copy link
Contributor Author

germn commented Dec 17, 2016

I got it working!

Based on discussion here I created ugly patch that replaces org.renpy.android.PythonActivity with org.kivy.android.PythonActivity inside pyjnius:

def autoclass(clsname):
+    if clsname == 'org.renpy.android.PythonActivity':
+        clsname = 'org.kivy.android.PythonActivity'

And after that pyjnius works without crashes. You can test it here:
https://github.com/germn/python-for-android/tree/ugly_pyjnius_fix

I don't know how pyjnius/Java work, so it's hard for me to create normal fix.
May be information above will help someone who'll try to do it.

@germn
Copy link
Contributor Author

germn commented Dec 17, 2016

These are three separate issues, two of them affects log, one of them about pyjinus:

#962
#963
kivy/pyjnius#249

@germn germn closed this as completed Dec 17, 2016
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

1 participant