Kivy: import android Onlu on android© dotmodus

Kivy: import android Onlu on android

You may see error code below when you try to import android in your PC.

Traceback (most recent call last):
  File "main.py", line 5, in 
    from android.permissions import request_permissions, Permission
ModuleNotFoundError: No module named 'android'

For solving this, you can import platform like below:

from kivy.utils import platform

if platform == "android":
from android.permissions import request_permissions, Permission
request_permissions([Permission.READ_EXTERNAL_STORAGE, Permission.WRITE_EXTERNAL_STORAGE])
Author

Karobben

Posted on

2021-01-01

Updated on

2024-01-22

Licensed under

Comments