a immature kivy user: The issue of request_permission

64 views
Skip to first unread message

Steve Tony

unread,
Aug 6, 2023, 11:27:48 AM8/6/23
to Kivy users support
I want to call record_ Audio permission, but in higher versions this permission is considered 'dangerous', so I have to use request_ Permissions (), however,  from android.permissions import request_permissions, check_permission, Permission request_permissions([Permission.RECORD_AUDIO])   reported an error in the Python code. Do I need to import additional packages? Thank you all!

Robert

unread,
Aug 6, 2023, 12:51:37 PM8/6/23
to Kivy users support
Share the code formatted, and the full error message.

Steve Tony

unread,
Aug 7, 2023, 5:17:08 AM8/7/23
to Kivy users support
Thank you. I havn't completed my python code because I' m dealing with permission problems. I download the example files(main.py and android_permissions.py) from https://github.com/Android-for-Python/c4k_photo_example/blob/main/main.py. I put them into my python project but then it reported errors like:
Screenshot 2023-08-07 170416.png
Screenshot 2023-08-07 170338.png
Do I lose some important packages? Thank you all!

Robert

unread,
Aug 7, 2023, 1:07:53 PM8/7/23
to Kivy users support
This is not an error in Kivy.
The IDE you use is reporting a false error because it can't see the package 'android'.

The package 'android' does not and cannot exist on a desktop device, the IDE does not understand that.

I presume your  IDE has some setting for this, but I don't know anything specific about that.

Steve Tony

unread,
Aug 8, 2023, 4:46:04 AM8/8/23
to Kivy users support
Thank you a lot! I may be able to solve the problem by myself. I find another question that my android platform api is 30, but my buildozer.spec is set like:

Screenshot 2023-08-08 163314.png 

So it won' t work if I want to call  record_audio. How can I update android ndk and sdk? And what else needs to be updated if I upgrade target API level? I use the vpn software so the network is instable. I think I need download those packages so that I can package successfully. Thank you again!

Robert

unread,
Aug 8, 2023, 7:52:53 AM8/8/23
to Kivy users support
That is several years old, I expect it won't work.
Of course I don't know why some of those values are what they are, so I can't tell you what you should change.

I can tell you about the current defaults.

Reply all
Reply to author
Forward
0 new messages