Skip to content

bug: Webview not working on Android (APK) #6246

@Nicoschmiko

Description

@Nicoschmiko

Duplicate Check

Describe the bug

The example code from the Webview documantation doesn’t work. It’s just blank (gray) after the APK is built on Android.

Code sample

main.py
import flet_webview as fwv
import flet as ft

def main(page: ft.Page):

    page.add(

        fwv.WebView(

            url="https://flet.dev",

            on_page_started=lambda _: print("Page started"),

            on_page_ended=lambda _: print("Page ended"),

            on_web_resource_error=lambda e: print("WebView error:", e.data),

            expand=True,

        )

    )


ft.run(main)
requirements.txt
flet==0.81.0
flet-webview==0.81.0

To reproduce

flet build apk --android-permissions android.permission.INTERNET=true

Expected behavior

Webview showing

Screenshots / Videos

Image

Operating System

Windows

Operating system details

Build on: Windows 11 arm64 and x64
Testet on: Android 16

Flet version

0.81.0

Regression

I'm not sure / I don't know

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions