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
11.16k stars 429 forks source link

ModuleNotFound in apk build #3341

Closed marcodonatucci closed 1 month ago

marcodonatucci commented 4 months ago

Hi guys, I built an apk file of my python project that includes the cv2 module to scan a QR code, I built the p4a version with all the dependencies and I’m not including cv2 in the requirements file as specified in the Flet documentation. In the dist directory I can see cv2 in the specific directories like arm64 or x86_64… I added the dist to the path of serious python and I built the apk file. Everything went good but now when I open the file on my phone there’s a ModuleNotFound exception because he cannot find cv2. How can I solve this?

ProPython007 commented 2 months ago

Same problem! any updates? @marcodonatucci

marcodonatucci commented 2 months ago

I didn't check If they solved the issue with the new update, I'm sure they will because it's a very common problem as I'm seeing from the community. For now I found another way to implement the functionality of reading QR codes by adding the FilePicker and sending the image to an online qr decoding service by API. Hope this was helpful.

ndonkoHenri commented 1 month ago

Closing in favour of #3839