jnius error

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
isah1221
Newbie
Posts: 14
Joined: Tue Apr 13, 2021 6:34 am
Github: isah1221
itch: isah1221
Contact:

jnius error

#1 Post by isah1221 »

init python:
def i():
if renpy.android:
import jnius
mActivity = jnius.autoclass("org.renpy.android.PythonSDLActivity")
else:
mActivity = None
Guys, this is my code. It's the same as the tutorial. I brought over the tutorial code to show you (ha, I won't change the stupid "jinus" for now).
init python:
if renpy.android:
import jinus
mActivity = jnius.autoclass("org.renpy.android.PythonSDLActivity")
else:
mActivity = None
Except for jinus, it's pretty much the same, probably the only difference is that I've defined it in the method. And then it gave me this error: JavaExpection:JVM expection occurred:Can't create handler inside thread[SDLThread,5,main] that has not called Looper.prepare()

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: jnius error

#2 Post by Tess »

If you put code in a function (in this case "i"), the code inside it won't run until the function is called.
Do you call i() in your script, and if so where/how do you do it?

Post Reply

Who is online

Users browsing this forum: No registered users