Matplotlib in android kivy app error

Hi everyone, new to forum so please don’t mind errors on my side.

I’m working on a simple kivy app which creates databases and outputs data from them in png.
It’s about football club; players in a team, their attendance to training sessions and output of attendance for particular month.

So I’m using matplotlib for png output file, and I’ve made an android package with Colaboratory, installed the app to my phone. The app is working to the point when I try to create a png file, then it crashes.

I think it’s due to this part of code and matplotlib:

        # Set autowidth columns
        the_table.auto_set_column_width(col=list(range(2, len(df_result.columns))))

        plt.title(f'Popis dolazaka - {app.category_chosen} - {target_month}.{target_year}', fontsize=12, loc='left')

        plt.tight_layout()

        plt.savefig(f"Popis_dolazaka_{app.category_chosen}_{target_month}_{target_year}.png", bbox_inches='tight')

Any help would be much appreciated.

What exactly does this mean? What do you see happening at this point?

If there is an error traceback, please show the complete traceback, formatted the same way as the code. Otherwise, please explain more clearly.

In Visual Studio Code everything works perfectly, png is created when I press the button.
But on phone, on button press the app just crashes, it exits the window.

Here is the entire code on github (only difference is that the output is in pdf) - football_app/main.py at main · jfort0/football_app · GitHub