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

PythonActivity.mActivity causes app crash with new toolchain #995

Closed
WillDHB opened this issue Jan 25, 2017 · 4 comments
Closed

PythonActivity.mActivity causes app crash with new toolchain #995

WillDHB opened this issue Jan 25, 2017 · 4 comments

Comments

@WillDHB
Copy link

WillDHB commented Jan 25, 2017

The following code causes an app to crash instantly:

from jnius import autoclass
PythonActivity = autoclass('org.renpy.android.PythonActivity')
ac = PythonActivity.mActivity

I have encountered this in a Kivy app I've built with buildozer, and have seen the issue across multiple devices. I have also reproduced this issue in the remote shell. I had not seen this occur when using the old toolchain.

@KeyWeeUsr
Copy link
Contributor

What about org.kivy.android.PythonActivity? I works with renpy call anyway (source), so I'm not sure why this fails for you, as it works for me with with latest versions.

App output(logcat) would be really nice to have. :)

@WillDHB
Copy link
Author

WillDHB commented Jan 26, 2017

org.kivy.android.PythonActivity does not seem to have the problem:

>>> from jnius import autoclass
>>> PythonActivity = autoclass('org.kivy.android.PythonActivity')
>>> ac = PythonActivity.mActivity
>>> # Note how it didn't crash 
>>> PA2 = autoclass('org.renpy.android.PythonActivity')
>>> PA2.mActivity # ...and crash

I do not know whether it would have crashed if I'd tried to do something more substantial with org.kivy.android.PythonActivity.

Here's a log file:
deviceid_log.txt

I have seen this issue on a OnePlus One, an AVD emulator emulating a Nexus 6, and a Pixel.

@germn
Copy link
Contributor

germn commented Feb 1, 2017

Probably it's this issue. You can try temporary fix mentioned there.

@inclement
Copy link
Member

The PythonActivity class used to be org.renpy.android.PythonActivity in the old toolchain (and still is in the pygame bootstrap), but in all the others it is now org.kivy.android.PythonActivity. If you're using the new toolchain and anything except the pygame bootstrap, just change the references in your code to org.kivy.android.PythonActivity.

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

4 participants