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
9.96k stars 392 forks source link

Unknown control: flashlight #3599

Closed Andrukva closed 1 day ago

Andrukva commented 4 days ago

Duplicate Check

Describe the bug

When running on a physical device, it gives the error "unknown control: flashlight " and also swears at lambda. I use Windows11, Android Studio, Python 3.12.4 and Android 7. Please tell me how to fix it? Thank you in advance.

Code

import flet as ft

def main(page: ft.Page): flashLight = ft.Flashlight() page.overlay.append(flashLight) page.add( ft.TextButton("toggle", onclick: lambda : flashlight.toggle()) )

ft.app(target=main)

To reproduce

Unknown module flashlight

Expected behavior

No response

Screenshots

No response

Operating System

Windows

Operating system details

Windows 11

Flet version

0.23.2

Regression

I'm not sure / I don't know

Suggestions

No response

Additional details

No response

ndonkoHenri commented 3 days ago

Using the official Flet app? Or an apk you built?

burhansvural commented 3 days ago

flet_flaslight

ndonkoHenri commented 3 days ago

I guess that's an apk you built. It's really strange. Please make sure you are really using the latest Flet version: flet --version Also, please share the logs of your app, with verbosity: https://flet.dev/docs/publish#verbose-logging

burhansvural commented 3 days ago

flet version : 0.24.0.dev3087

TheEthicalBoy @.***>, 4 Tem 2024 Per, 23:32 tarihinde şunu yazdı:

I guess that's an apk you built. It's really strange. Please make sure you are really using the latest Flet version: flet --version Also, please share the logs of your app, with verbosity: https://flet.dev/docs/publish#verbose-logging

— Reply to this email directly, view it on GitHub https://github.com/flet-dev/flet/issues/3599#issuecomment-2209537767, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDXQYGSA3S6BW3GTSZOBWZTZKWWMVAVCNFSM6AAAAABKKZKGWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGUZTONZWG4 . You are receiving this because you commented.Message ID: @.***>

Andrukva commented 2 days ago

flet_flaslight

I got the same result.

Andrukva commented 2 days ago

I have version Flet 0.23.2 and python version 3.12.4. I ran the code through the android studio and vs code. Windows 11.

ndonkoHenri commented 2 days ago

I tried it in my simulator and it works.

Please explain step-by-step how you run the code? Do you create an apk file? Or make use of the official Flet mobile app?

Andrukva commented 1 day ago

I am using the official mobile app Flet for Android. page.add(ft.TextButton("toggle", onclick:lambda : flashlight.toggle())). This line of code leads to an error. Swears at the colon after on_click: . I did not create Apk. I'm testing on Redmi note 5 android 9.

ndonkoHenri commented 1 day ago

Yep, that was my guess. Please subscribe to this: https://github.com/flet-dev/flet/issues/3096