You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
12-15 16:48:21.692 18623 18646 I python : Traceback (most recent call last):
12-15 16:48:21.692 18623 18646 I python : WARNING:kivy:stderr: Traceback (most recent call last):
12-15 16:48:21.693 18623 18646 I python : File "main.py", line 20, in <module>
12-15 16:48:21.693 18623 18646 I python : WARNING:kivy:stderr: File "main.py", line 20, in <module>
12-15 16:48:21.694 18623 18646 I python : view.setKeepScreenOn(True)
12-15 16:48:21.694 18623 18646 I python : WARNING:kivy:stderr: view.setKeepScreenOn(True)
12-15 16:48:21.695 18623 18646 I python : File "jnius/jnius_export_class.pxi", line 734, in jnius.JavaMethod.__call__ (jnius/jnius.c:25894)
12-15 16:48:21.695 18623 18646 I python : WARNING:kivy:stderr: File "jnius/jnius_export_class.pxi", line 734, in jnius.JavaMethod.__call__ (jnius/jnius.c:25894)
12-15 16:48:21.697 18623 18646 I python : File "jnius/jnius_export_class.pxi", line 828, in jnius.JavaMethod.call_method (jnius/jnius.c:27082)
12-15 16:48:21.697 18623 18646 I python : WARNING:kivy:stderr: File "jnius/jnius_export_class.pxi", line 828, in jnius.JavaMethod.call_method (jnius/jnius.c:27082)
12-15 16:48:21.698 18623 18646 I python : File "jnius/jnius_utils.pxi", line 93, in jnius.check_exception (jnius/jnius.c:4012)
12-15 16:48:21.698 18623 18646 I python : WARNING:kivy:stderr: File "jnius/jnius_utils.pxi", line 93, in jnius.check_exception (jnius/jnius.c:4012)
12-15 16:48:21.699 18623 18646 I python : jnius.JavaException: JVM exception occurred: Only the original thread that created a view hierarchy can touch its views.
12-15 16:48:21.699 18623 18646 I python : WARNING:kivy:stderr: jnius.JavaException: JVM exception occurred: Only the original thread that created a view hierarchy can touch its views.
12-15 16:48:21.822 18623 18646 I python : Python for android ended.
12-15 16:48:21.830 18623 18623 V SDL : onWindowFocusChanged(): false
12-15 16:48:21.833 18623 18623 V PythonActivity: onPause()
12-15 16:48:21.833 18623 18623 V SDL : onPause()
12-15 16:48:21.833 18623 18623 V SDL : nativePause()
12-15 16:48:21.833 18623 18623 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 18623 (ample.myaasdqpp)
The text was updated successfully, but these errors were encountered:
fr3nzy
changed the title
' Only the original thread that created a view hierarchy can touch its views.' error when attempting to access View class
' Only the original thread that created a view hierarchy can touch its views.' error when attempting to access android.view.Window methods
Dec 15, 2018
The error basically means that you are running PyJNIus, and your application, in a non-main Thread which is the default behavior for android, I believe. Correct me if I'm wrong.
Imagine it like a Kivy main loop which polls for various events and what you try to do is like sleep(1). By default you'd freeze your UI in Kivy unless using kivy.clock.Clock, but what Android does is that it does not allow you to do anything like that. You'll need to explicitly run your code on the main Thread via java.lang.Runnable and android.app.Activity.runOnUiThread, e.g. like this example.
Or, you can just import the behavior from the android package in android.runnable.run_on_ui_thread, but don't forget to add it to your requirements too!
The same error occurs when using a different method of
android.view.Window
:The text was updated successfully, but these errors were encountered: