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

Any call to variant of overloaded function leads to jnius.jnius.JavaException: No methods matching your arguments, available: [] #427

Open
jtc0de opened this issue Jun 26, 2019 · 1 comment

Comments

@jtc0de
Copy link
Member

commented Jun 26, 2019

While revamping something about handling the services part of python-for-android I ran into this pyjnius error which seems to be a bug when calling the following now changed function in as defined in my pull request:


    public static void start_service(
            String serviceTitle,
            String serviceDescription,
            String pythonServiceArgument
            ) {
        // This is the legacy call with less parameters!
        start_service(
            serviceTitle, serviceDescription, pythonServiceArgument, true
        );
    }

    public static void start_service(
            String serviceTitle,
            String serviceDescription,
            String pythonServiceArgument,
            boolean showForegroundNotification
            ) {

(the function is defined at this position: https://github.com/kivy/python-for-android/blob/7a7d8ee9ec3450c377c473e5a1b14b4db6932efa/pythonforandroid/bootstraps/sdl2/build/src/main/java/org/kivy/android/PythonActivity.java#L368 )

The failing pyjnius call looks like this:

mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
mActivity.start_service(
    "PythonService",
    "My Service",
    "",
    False,
)

The call results in this error:

06-26 08:16:34.350  7350  7460 I python  :   File "jnius/jnius_export_class.pxi", line 1034, in jnius.jnius.JavaMultipleMethod.__call__
06-26 08:16:34.350  7350  7460 I python  : jnius.jnius.JavaException: No methods matching your arguments, available: []

This seems to be just wrong, and it looks like pyjnius simply didn't identify the function signature correctly for whatever reason. Is the overloading handling broken in some way?

Steps to reproduce:

  1. pip3 install https://github.com/JonasT/python-for-android/archive/fix_forced_service_foreground.zip
  2. Build an kivy app that has the following call (it doesn't need to actually have a service or any other reasonable setup, since that would fail AFTER this error occurs):
    mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
    mActivity.start_service("bla", "blubb, "", False)
  1. Run the app
@jtc0de

This comment has been minimized.

Copy link
Member Author

commented Jun 26, 2019

Ok I'm just realizing I have an override for a static method there, I assume that is probably the issue / what's not working right. I solved things differently now (by just avoiding doing that) so this is no longer anything urgent, but I'll leave the issue up so hopefully myself or someone else will get around to look at this on occasion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.