flet icon indicating copy to clipboard operation
flet copied to clipboard

Flet Apk does not run when generated with 0.25.X

Open gabriel-ribeiro-099 opened this issue 1 year ago • 6 comments

Duplicate Check

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

Describe the bug

Hey guys, I'm using Flet 0.25.1 in my project, but I'm having trouble running the generated APK. To clarify my doubts, I decided to create a new Flet project using flet create. I built the APK of the sample code that comes with the project, but even the APK of the sample code doesn't run on my Asus or Samsung phones, nor on the Android emulator.

I'm getting this error:

12-03 03:44:49.852  6542  6542 W com.flet.src: type=1400 audit(0.0:141): avc: denied { read } for name="max_map_count" dev="proc" ino=50995 scontext=u:r:untrusted_app:s0:c166,c256,c512,c768 tcontext=u:object_r:proc_max_map_count:s0 tclass=file permissive=0 app=com.flet.src

Even when using a rooted phono with setenforce 0 the error persists

When I click on the app icon, it goes to a blank white page and then closes automatically, showing the following message: "src stopped working."

Code sample

Code
import flet as ft


def main(page: ft.Page):
    counter = ft.Text("0", size=50, data=0)

    def increment_click(e):
        counter.data += 1
        counter.value = str(counter.data)
        counter.update()

    page.floating_action_button = ft.FloatingActionButton(
        icon=ft.Icons.ADD, on_click=increment_click
    )
    page.add(
        ft.SafeArea(
            ft.Container(
                counter,
                alignment=ft.alignment.center,
            ),
            expand=True,
        )
    )


ft.app(main)

To reproduce

  1. flet build apk (i also tried with flet build apk --arch x86_64)
  2. adb install C:\Users\youruser\path_to_apk_folder\app-release.apk (make sure that a adb devices is running)
  3. adb logcat -s "com.flet.src" (to see logs of flet app)

Expected behavior

I expected the APK of the sample code to run, but instead, I get a blank white screen and the error described above.

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 11

Flet version

0.25.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs
12-03 03:59:07.542  6613  6613 W com.flet.src: type=1400 audit(0.0:142): avc: denied { read } for name="max_map_count" dev="proc" ino=50995 scontext=u:r:untrusted_app:s0:c166,c256,c512,c768 tcontext=u:object_r:proc_max_map_count:s0 tclass=file permissive=0 app=com.flet.src

Additional details

No response

gabriel-ribeiro-099 avatar Dec 03 '24 15:12 gabriel-ribeiro-099