flet icon indicating copy to clipboard operation
flet copied to clipboard

flet==0.25.0.dev3526 apk "Android" error Pillow PIL "libjpeg.so" not found

Open jtoror opened this issue 1 year ago • 1 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

Apk "Android" error Pillow PIL ImportError: dlopen failed: library "libjpeg.so" not found

Code sample

Code

pyproject.toml

[project]
name = "amy_app"
version = "1.0.0"
description = "My first Flet project"
authors = [
    {name = "John Smith", email = "[email protected]"}
]

dependencies = [
    "flet==0.25.0.dev3526",
    "numpy",
    "pandas",
    "imagekitio",
    "supabase",
    "Pillow",
    "libjpeg",
    "plotly"
]

# requires-python = ">=3.12"

icon = "assets/icon"

[tool.flet.android.permission] # --android-permissions
"android.permission.INTERNET" = true
"android.permission.CAMERA" = true
"android.permission.READ_EXTERNAL_STORAGE" = true
"android.permission.WRITE_EXTERNAL_STORAGE" = true
"android.permission.READ_MEDIA_VISUAL_USER_SELECTED" = true

main.py

import os
import flet as ft
import numpy as np
# import pandas as pd
from imagekitio import ImageKit
from supabase import create_client, Client
from PIL import Image
import plotly.express as px


def main(page: ft.Page):
    page.title = "Flet counter example"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER

    txt_number = ft.TextField(
        value="0", text_align=ft.TextAlign.RIGHT, width=100)

    def minus_click(e):
        txt_number.value = str(int(txt_number.value) - 1)
        page.update()

    def plus_click(e):
        txt_number.value = str(int(txt_number.value) + 1)
        page.update()

    page.add(
        ft.Row(
            [
                ft.IconButton(ft.icons.REMOVE, on_click=minus_click),
                txt_number,
                ft.IconButton(ft.icons.ADD, on_click=plus_click),
            ],
            alignment=ft.MainAxisAlignment.CENTER,
        )
    )


ft.app(main)


To reproduce

Traceback (most recent call last): File "", line 43, in File "", line 229, in run_module File "", line 88, in _run_code File "/data/user/0/com.flet.amy_app/files/flet/app/main.py", line 7, in from PIL import Image File "/data/user/0/com.flet.amy_app/files/flet/python_site_packages/PIL/Image.py", line 100, in from . import _imaging as core ImportError: dlopen failed: library "libjpeg.so" not found

Expected behavior

No response

Screenshots / Videos

Captures

image

Operating System

Linux

Operating system details

Kubuntu 24.04

Flet version

0.25.0.dev3526

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

jtoror avatar Oct 20 '24 15:10 jtoror

I'm having the same problem.

liuguanfei avatar Oct 21 '24 03:10 liuguanfei

Hi @FeodorFitsner , what happened with this? Has it been resolved?

jtoror avatar Oct 31 '24 18:10 jtoror

It's been fixed.

FeodorFitsner avatar Nov 06 '24 18:11 FeodorFitsner