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

PR 2285 breaks requestPermissions #2304

Closed
5 tasks done
misl6 opened this issue Aug 27, 2020 · 2 comments · Fixed by #2341
Closed
5 tasks done

PR 2285 breaks requestPermissions #2304

misl6 opened this issue Aug 27, 2020 · 2 comments · Fixed by #2341

Comments

@misl6
Copy link
Member

misl6 commented Aug 27, 2020

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: Python 3.8.2 (default, Jul 16 2020, 14:00:26)
  • OS: Ubuntu 20.04.1 LTS
  • Kivy: master
  • Cython: 0.29.17
  • OpenJDK: 1.8.0_265

Description

After PR #2285 , the app crashes when calling the following instruction.

request_permissions([Permission.ACCESS_COARSE_LOCATION])

buildozer.spec

Command:

buildozer android debug deploy run

Logs

08-27 18:05:07.895 18125 18146 I python  :    File "jnius/jnius_export_class.pxi", line 1134, in jnius.jnius.JavaMultipleMethod.__call__
08-27 18:05:07.896 18125 18146 I python  :  jnius.jnius.JavaException: No methods matching your arguments, requested: (['android.permission.ACCESS_COARSE_LOCATION'],), available: []
08-27 18:05:07.896 18125 18146 I python  : Python for android ended.
@misl6 misl6 changed the title PR 2285 breaks permissionRequest PR 2285 breaks requestPermissions Aug 28, 2020
@obfusk
Copy link
Contributor

obfusk commented Aug 31, 2020

Relevant pyjnius issue: kivy/pyjnius#538.

@obfusk
Copy link
Contributor

obfusk commented Oct 20, 2020

This seems to be a bug in p4a's android library.

It looks like python_activity.requestPermissions is a non-static method. But it's being called as if it were static. Which for some reason used to work with older versions of pyjnius. Using python_activity.mActivity.requestPermissions instead seems to work with 1.3.0.

I'm not sure whether the best way to fix this is to make the method static (if that doesn't break anything) or to call it on the instance. And I suspect there are more cases where this happens.

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

Successfully merging a pull request may close this issue.

2 participants