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

kivy cant load image in requesturl android #2832

Closed
jabarmajidi opened this issue Jun 3, 2023 · 7 comments
Closed

kivy cant load image in requesturl android #2832

jabarmajidi opened this issue Jun 3, 2023 · 7 comments

Comments

@jabarmajidi
Copy link

jabarmajidi commented Jun 3, 2023

I want to get images from my site using UrlRequest and API to display them in Kivy. this code The codes I wrote work correctly in Windows and Linux, but in Android it gives me a black picture. In fact, it cannot load the photo

this is my codes:

home_page.py:

from kivymd.uix.screen import MDScreen
from kivy.network.urlrequest import UrlRequest


class HomePage(MDScreen):

    def on_enter(self):
        self.free_courses()

    def free_courses(self):
        data = UrlRequest('my api')
        data.wait(delay=0.5)
        for course in data.result:
            self.ids.free_courses.add_widget(FreeCourses(
                image=course.get('app_image'),
                title=course.get('category_name')))

home_page.kv:

<FreeCourses>
    size_hint: None, None

    MDRelativeLayout:
        size_hint: None, None
        size: 100, 100
        FitImage:
            source: root.image
            size_hint: None, None
            size: 100, 80
            radius: [10,]
            pos_hint: {'center_x':0.5, 'center_y': 0.6}
@kuzeyron
Copy link
Contributor

kuzeyron commented Jun 3, 2023

[Support question -> Kivy@Discord]
Sounds like you are missing the INTERNET permission in the spec file.

@jabarmajidi
Copy link
Author

jabarmajidi commented Jun 3, 2023

@kuzeyron
this is in buildozer.spec
andriod.permissions = android.permission .INTERNET, (name=android.permission.WRITE_STORAGE;maxSdkVersion=18)

@kuzeyron
Copy link
Contributor

kuzeyron commented Jun 3, 2023

Just android.permissions = android.permission.INTERNET should be fine. The other part looks to be an example to be used without the parentheses. Then you should probably clean the old cached data with buildozer appclean.

@jabarmajidi
Copy link
Author

jabarmajidi commented Jun 3, 2023

@kuzeyron
i run buildozer appclean. not it rais this error:
in case of a bug report, lease add a full log with log_leve = 2

@kuzeyron
Copy link
Contributor

kuzeyron commented Jun 3, 2023

Please share the entire buildozer.spec. How recent is your buildozer version?

@RobertFlatt
Copy link
Contributor

Copy link

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants