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

org.kivy.android.PythonActivity$NewIntentListener is not visible from class loader java.lang.IllegalArgumentException #2770

Closed
Ahd999 opened this issue Mar 20, 2023 · 1 comment

Comments

@Ahd999
Copy link

Ahd999 commented Mar 20, 2023

App used to check: Pydroid3

The Code:

`
from jnius import cast
from jnius import autoclass
from android import activity
import kivy

PythonActivity=autoclass('org.renpy.android.PythonActivity')
Intent = autoclass('android.content.Intent')

intent = Intent()
intent.setAction(Intent.ACTION_PICK)
intent.setType("image/*")

PythonActivity.mActivity.startActivityForResult(intent, 0x123)

def on_activity_result(requestCode, resultCode, data):
        print ("### ACTIVITY CALLBACK ###")

def on_new_intent(intent):
        print ("#### INTENT", intent)
activity.bind(on_new_intent=on_new_intent,
on_activity_result=on_activity_result)

`

The error:

Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/temp_iiec_codefile.py", line 24, in <module> activity.bind(on_new_intent=on_new_intent,on_activity_result=on_activity_result) File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/android/activity.py", line 43, in bind listener = NewIntentListener(callback) File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/android/activity.py", line 17, in __init__ super().__init__(**kwargs) File "jnius/jnius_proxy.pxi", line 28, in jnius.jnius.PythonJavaClass.__init__ File "jnius/jnius_proxy.pxi", line 34, in jnius.jnius.PythonJavaClass._init_j_self_ptr File "jnius/jnius_proxy.pxi", line 182, in jnius.jnius.create_proxy_instance File "jnius/jnius_export_class.pxi", line 856, in jnius.jnius.JavaMethod.__call__ File "jnius/jnius_export_class.pxi", line 1028, in jnius.jnius.JavaMethod.call_staticmethod File "jnius/jnius_utils.pxi", line 91, in jnius.jnius.check_exception jnius.jnius.JavaException: JVM exception occurred: interface org.kivy.android.PythonActivity$NewIntentListener is not visible from class loader java.lang.IllegalArgumentException

Sorry for the cluttered code, and thanks in advance for any help

@Ahd999 Ahd999 closed this as completed Mar 20, 2023
@Ahd999
Copy link
Author

Ahd999 commented Mar 20, 2023

Wrong place for posting I'd do it at pyjnius

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