Skip to content

kivy cant load image in requesturl android #2832

Closed

Description

@jabarmajidi

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}

Activity

  1. kuzeyron commented on Jun 3, 2023

    @kuzeyron
    Contributor

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

  2. jabarmajidi commented on Jun 3, 2023

    @jabarmajidi
    Author

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

  3. kuzeyron commented on Jun 3, 2023

    @kuzeyron
    Contributor

    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.

  4. jabarmajidi commented on Jun 3, 2023

    @jabarmajidi
    Author

    @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

  5. kuzeyron commented on Jun 3, 2023

    @kuzeyron
    Contributor

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

  6. RobertFlatt commented on Jun 8, 2023

    @RobertFlatt
    Contributor
  7. github-actions commented on Dec 17, 2023

    @github-actions

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions