flet icon indicating copy to clipboard operation
flet copied to clipboard

ModuleNotFoundError On runtime apk

Open khadimFaye opened this issue 11 months ago • 3 comments

Im building a flet app for android, everything work properly on windows but when i finish the apk build i always have ModuleNotFoundError

I thing flet build apk does not include custums module in src directory i really need some help to fix this !

image

khadimFaye avatar Dec 29 '25 20:12 khadimFaye

OK, see what you have inside your .apk.

Rename .apk to .zip and unpack it. Locate app.zip at assets/flutter_assets/app inside of an archive. Unpack app.zip and check if you have custom modules there.

Then try displaying sys.path in your app, by adding something like:

import sys

# ...

def main(page: ft.Page):
    page.add(ft.Text(f"sys.path: {sys.path}"))

FeodorFitsner avatar Dec 29 '25 23:12 FeodorFitsner

The issue has been fixed. .apk package built on Windows (can be downloaded from here) is running on Android emulator just fine.

Delete build directory inside app's dir before re-building. Let me know how that worked for you.

FeodorFitsner avatar Dec 30 '25 03:12 FeodorFitsner

Hello @FeodorFitsner

Mu last build worked🚀🤩properly on android without any issues for now

Thanks Happy hollidays

khadimFaye avatar Dec 30 '25 12:12 khadimFaye