flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
10.79k stars 417 forks source link

ModuleNotFoundError: No module named 'flet.map' when i build apk #3633

Closed asil004 closed 2 weeks ago

asil004 commented 1 month ago

Duplicate Check

Describe the bug

Traceback (most recent call last): File "", line 43, in File "", line 229, in run_module File "", line 88, in _run_code File "/tmp/serious_python_tempPCCXXV/main.py", line 4, in File "/tmp/serious_python_tempPCCXXV/pages/about.py", line 3, in File "/tmp/serious_python_tempPCCXXV/components/background/login_background.py", line 2, in ModuleNotFoundError: No module named 'flet.map'

Code sample

Logs ```python import flet.map as map map.Map( height=315, expand=True, configuration=map.MapConfiguration( initial_center=map.MapLatitudeLongitude(41.2995, 69.2401), initial_zoom=16, interaction_configuration=map.MapInteractionConfiguration( flags=map.MapInteractiveFlag.ALL ), ), layers=[ map.TileLayer( url_template="https://tile.openstreetmap.org/{z}/{x}/{y}.png", on_image_error=lambda e: print("TileLayer Error"), ), ], ), ```

To reproduce

flet build apk --include-packages flet_map

Expected behavior

No response

Screenshots / Videos

Screenshots / Video demonstration [Upload media here]

Operating System

Linux

Operating system details

Ubuntu 22.04

Flet version

0.23.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

ndonkoHenri commented 1 month ago

I reproduced the issue with the test code from the docs: https://flet.dev/docs/controls/map#example

asil004 commented 1 month ago

I reproduced the issue with the test code from the docs: https://flet.dev/docs/controls/map#example

Screenshot 2024-07-19 115046

i have already the same issue

buil command flet build windows --include-packages flet_map

the map code

class AboutBackground(Container):
    def __init__(self, image_src):
        super().__init__(
            expand=True,
            bgcolor=BACK_OPACITY_DARK,
            opacity=0.3,
            padding=0,
            alignment=Alignment(0, 0),

            content=Column(
                expand=True,
                spacing=0,
                controls=[
                    Image(src=image_src, height=720, fit=ImageFit.COVER, width=1920),

                    map.Map(
                        height=315,
                        expand=True,
                        configuration=map.MapConfiguration(
                            initial_center=map.MapLatitudeLongitude(41.2995, 69.2401),
                            initial_zoom=16,
                            interaction_configuration=map.MapInteractionConfiguration(
                                flags=map.MapInteractiveFlag.ALL
                            ),

                        ),
                        layers=[
                            map.TileLayer(
                                url_template="https://tile.openstreetmap.org/{z}/{x}/{y}.png",
                                on_image_error=lambda e: print("TileLayer Error"),
                            ),

                        ],
                    ),
                ]
            )
        )
felipelobo16 commented 2 weeks ago

Try:

import flet_core.map as map

asil004 commented 1 week ago

Try:

import flet_core.map as map

image

already error!

ndonkoHenri commented 1 week ago

try the latest pre-release using pip install flet -U --pre