Skip to content

Flet Build Apk Issue #5115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Muddassir-Farooq-official opened this issue Mar 23, 2025 · 1 comment
Closed
1 task done

Flet Build Apk Issue #5115

Muddassir-Farooq-official opened this issue Mar 23, 2025 · 1 comment
Labels
status: awaiting response Further information is requested

Comments

@Muddassir-Farooq-official

Duplicate Check

Describe the bug

i am facing an issue in latest flet version its not building apk file

Code sample

Code
import flet as ft

def main(page: ft.Page):
    page.title = "Bistro Deep Linking Demo"
    page.vertical_alignment = ft.MainAxisAlignment.CENTER
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER

    # Function to handle route changes
    def route_change(route):
        page.views.clear()
        # Strip the custom scheme if present, focus on the path
        path = page.route.replace("bistro://", "") or "/"
        if path == "/":
            page.views.append(
                ft.View(
                    "/",
                    [
                        ft.Text("Welcome to Bistro Home", size=30),
                        ft.ElevatedButton("Go to Menu", on_click=lambda _: page.go("/menu")),
                    ],
                )
            )
        elif path == "/menu":
            page.views.append(
                ft.View(
                    "/menu",
                    [
                        ft.Text("Bistro Menu", size=30),
                        ft.ElevatedButton("Back Home", on_click=lambda _: page.go("/")),
                    ],
                )
            )
        else:
            page.views.append(
                ft.View(
                    "/notfound",
                    [ft.Text("404 - Page Not Found", size=30)],
                )
            )
        page.update()

    # Handle initial route on app start
    page.on_route_change = route_change
    page.go(page.route if page.route else "/")  # Default to home if no route

ft.app(target=main)

To reproduce

i want to build apk with deep lkinking support

Expected behavior

ptproject file

[project]
name = "Bistro"
version = "1.0.0"
description = "Bistro App"
authors = [
{name = "John Smith", email = "john@email.com"}
]
dependencies = ["flet==0.27.6"]

[tool.flet.app.boot_screen]
show = true
message = "Preparing Application"

[tool.flet.app.startup_screen]
show = true
message = "Checking Network Security"

[tool.flet]
compile.app = true # --compile-app
compile.packages = true # --compile-packages
compile.cleanup = true # --cleanup-on-compile
permissions = ["camera", "microphone"] # --permissions
android-api-level = "33"
package = "com.bistro.app" # Optional, but recommended for uniqueness

[tool.flet.splash]
color = "#ffffff" # --splash-color
dark_color = "#ffffff" # --splash-dark-color
web = false # --no-web-splash
ios = false # --no-ios-splash
android = false # --no-android-splash

[tool.flet.android]
adaptive_icon_background = "" # --android-adaptive-icon-background
split_per_abi = false # --split-per-abi

[tool.flet.android.deep_linking]
scheme = "bistro" # Custom scheme (no :// needed here)

host = "deeplink" # Optional: specify a host if needed

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 10

Flet version

0.27.6

Regression

No, it isn't

Suggestions

No response

Logs

             at org.gradle.cache.internal.btree.FileBackedBlockStore$BlockImpl.blockCorruptedException(FileBackedBlockStore.java:267)
               at org.gradle.cache.internal.btree.FileBackedBlockStore$BlockImpl.read(FileBackedBlockStore.java:236)
               at org.gradle.cache.internal.btree.FileBackedBlockStore.read(FileBackedBlockStore.java:123)
               at org.gradle.cache.internal.btree.CachingBlockStore.read(CachingBlockStore.java:100)
               at org.gradle.cache.internal.btree.FreeListBlockStore.read(FreeListBlockStore.java:86)
               at org.gradle.cache.internal.btree.StateCheckBlockStore.read(StateCheckBlockStore.java:67)
               at org.gradle.cache.internal.btree.BTreePersistentIndexedCache.put(BTreePersistentIndexedCache.java:147)
               ... 18 more

       FAILURE: Build completed with 2 failures.

       1: Task failed with an exception.
       -----------
       * What went wrong:
       A problem occurred configuring project ':webview_flutter_android'.
       > A build operation failed.
             Could not read workspace metadata from C:\Users\Muddassir Farooq\.gradle\caches\transforms-4\3737ae760da839c0d2952de5fbee7970\metadata.bin
          > Could not read workspace metadata from C:\Users\Muddassir Farooq\.gradle\caches\transforms-4\3737ae760da839c0d2952de5fbee7970\metadata.bin
       > Failed to notify project evaluation listener.
          > Could not get unknown property 'android' for project ':webview_flutter_android' of type org.gradle.api.Project.
          > Could not get unknown property 'android' for project ':webview_flutter_android' of type org.gradle.api.Project.

       * Try:
       > Run with --stacktrace option to get the stack trace.
       > Run with --info or --debug option to get more log output.
       > Run with --scan to get full insights.
       > Get more help at https://help.gradle.org.
       ==============================================================================

       2: Task failed with an exception.
       -----------
       * What went wrong:
       Failed to query the value of property 'buildFlowServiceProperty'.
       > Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@24e11268 of type BuildFlowService.Parameters
          > A problem occurred configuring project ':webview_flutter_android'.
             > A build operation failed.
                   Could not read workspace metadata from C:\Users\Muddassir Farooq\.gradle\caches\transforms-4\3737ae760da839c0d2952de5fbee7970\metadata.bin
                > Could not read workspace metadata from C:\Users\Muddassir Farooq\.gradle\caches\transforms-4\3737ae760da839c0d2952de5fbee7970\metadata.bin
             > Failed to notify project evaluation listener.
                > Could not get unknown property 'android' for project ':webview_flutter_android' of type org.gradle.api.Project.
                > Could not get unknown property 'android' for project ':webview_flutter_android' of type org.gradle.api.Project.

       * Try:
       > Run with --stacktrace option to get the stack trace.
       > Run with --info or --debug option to get more log output.
       > Run with --scan to get full insights.
       > Get more help at https://help.gradle.org.
       ==============================================================================

       BUILD FAILED in 7s
       Running Gradle task 'assembleRelease'...                           11.2s
       Gradle task assembleRelease failed with exit code 1
       <_io.TextIOWrapper name=4 encoding='utf-8'>
       Run subprocess: ['C:\\src\\flutter_windows_3.19.6-stable\\flutter\\bin\\flutter.BAT', 'doctor', '--no-version-check', '--suppress-analytics']

[15:10:15] Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.2, on Microsoft Windows [Version 10.0.19045.5608], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
X Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.0)
[√] Android Studio (version 2023.2)
[√] VS Code (version 1.98.2)
[√] Connected device (3 available)
[√] Network resources

       ! Doctor found issues in 1 category.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ Error building Flet app - see the log of failed command above. │╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
PS C:\Users\Muddassir Farooq\Desktop\New Deep> ```

Additional details

No response

@ndonkoHenri
Copy link
Contributor

Please share the complete logs.

@ndonkoHenri ndonkoHenri added the status: awaiting response Further information is requested label Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting response Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants