0

I am working on a kivy project with images.It works well on my laptop. but the problem is ,buildozer is not loading images in my android app even my icon is not changing. I am new to stackoverflow can somebody say what can I do to solve this problem, Thanks In advance my main.py file is here main thing I am using google colab

#imports
from  kivy.app import App
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen,ScreenManager
from kivy.core.window import Window
#mainclass

class PDPay(MDApp):
    global screenmanager
    screenmanager=ScreenManager()
    def build(self):
        self.title="PDPay"
        screenmanager.add_widget(Builder.load_file("MenuScreen.kv"))
        return screenmanager

###run

PDPay().run()

and my menuscreen.kv file is here

#:import gch kivy.utils.get_color_from_hex
<AppBar@MDBoxLayout>:
    padding:'2dp'
    pos_hint:{'center_y':.95}
    adaptive_height:True
    MDIconButton:
        id:back_btn
        icon:'arrow-left'
    MDLabel:
        text:'PDPay'
        font_style:'H6'
        halign:'center'
        valign:'center'
    Widget:
        size_hint_x:.2



MDScreen:
    name:'loginpage'
    AsyncImage:
        source:'giphy.gif'
    AppBar:
    MDCard:
        orientation:'vertical'
        radius:[20]
        border_radius:[5]
        size_hint:.60,.45
        elevation:24
        padding:'20dp'
        spacing:'12dp'
        pos_hint:{'center_x':.5,'center_y':.5}
        MDLabel:
            text:'PDPay'
            bold:True
            halign:'center'
            valign:'center'
            size_hint_y:None
            height:'24dp'
        Widget:
            size_hint_y:None
            height:'24dp'
        MDFillRoundFlatButton:
            text:'[b]Pay[/b]'
            bold:True
            pos_hint:{'center_x':.5}
        MDFillRoundFlatButton:
            text:'[b]Create account[/b]'
            bold:True
            pos_hint:{'center_x':.5}
        MDFillRoundFlatButton:
            text:'[b]More[/b]'
            bold:True
            pos_hint:{'center_x':.5}

This is my back screen gif

can youitself choose a image for icon

2 Answers2

0

You need to add the extension of the file to buildozer.spec file. You have used the .gif file so, you have to add gif in source.include_exts in your buildozer.spec file. Search for source.include_exts in the buildozer.spec file and put a comma and add gif there

Here is it,

source.include_exts = py,png,jpg,kv,atlas,gif
0

I had to learn the hard way, but I had no choice. Answer for the old toolchain: Delete the numbers in the names of all image files and don't forget to delete the numbers you deleted in the code you used to upload the image. I also deleted the numbers in the names of the variables and didn't touch them again because the code was working, you can try that too. And the size of the images should not exceed a certain level, I'm not sure how much, mine doesn't allow more than 100kb And also you need to look that too: Android kivy where to put application files (ini, images db etc)

DARKTITAN
  • 35
  • 4