Skip to content

bug:Python use Flet to build an APK,Why have it stopped at "Packaging Python app..." Here, there is no change? #6010

Closed as duplicate

Description

@GamerNoGamed

env:
python:3.12.9
flet:0.80.1

Question
In Android Studio, it is possible to successfully package the APK, but in Python, the APK cannot be successfully packaged.At the "Packaging Python app..." section, it is in the stopped state.

build LOG:
flet build apk --module-name app -vv
[00:49:36] Run subprocess: ['c:\programfiles\flutter_windows_3_38_6_stable\bin\flutter.BAT', '--version', '--no-version-check',
'--suppress-analytics']
[00:49:39] Flutter executable: D:\programfiles\flutter_windows_3_38_6_stable\bin\flutter.BAT
Dart executable: D:\programfiles\flutter_windows_3_38_6_stable\bin\dart.BAT
JAVA_HOME points to a JRE. Proceeding to install JDK.
JDK installed at C:\Users\Administrator\java\17.0.13+11
Configuring Flutter's path to JDK
Run subprocess: ['c:\programfiles\flutter_windows_3_38_6_stable\bin\flutter.BAT', 'config', '--no-version-check',
'--suppress-analytics', '--jdk-dir=C:\Users\Administrator\java\17.0.13+11']
[00:49:41] Setting "jdk-dir" value to "C:\Users\Administrator\java\17.0.13+11".

       You may need to restart any open editors for them to read new settings.
       JDK installed ✅
       Android SDK installation found at C:\Users\Administrator\AppData\Local\Android\Sdk
       Android SDK package "cmdline-tools;latest" is already installed
       Android SDK package "platform-tools" is already installed
       Android SDK package "platforms;android-35" is already installed
       Android SDK package "build-tools;34.0.0" is already installed
       Android SDK installed ✅

[00:53:07] Created app shell ✅
Run subprocess: ['c:\programfiles\flutter_windows_3_38_6_stable\bin\dart.BAT', 'run', '--suppress-analytics',
'serious_python:main', 'package', 'c:\pro\env', '--platform', 'Android', '-r', 'flet==0.80.1', '--exclude', 'build',
'--cleanup-packages', '--verbose']
[00:53:20] Running package command
Extra PyPi indexes: [https://pypi.flet.dev]
Creating asset directory: c:\pro_env_\build\flutter\app
Created temp directory: D:\tmp\usertmp\serious_python_tempfba9791b
Copying Python app from c:\pro_env_ to a temp directory
VERBOSE: Configured Android/arm64-v8a platform with sitecustomize.py at
D:\tmp\usertmp\serious_python_sitecustomize5daa4369\sitecustomize.py
Installing [flet==0.80.1] with pip command to c:\pro_env_\build\site-packages\arm64-v8a
VERBOSE: Downloading Python distributive from
https://github.com/astral-sh/python-build-standalone/releases/download/20250205/cpython-3.12.9+20250205-x86_64-pc-windows-msvc
-shared-install_only_stripped.tar.gz to
c:\pro_env_\build\flutter\build\cpython-3.12.9+20250205-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz
[01:15:07] VERBOSE: Extracting Python distributive from
c:\pro_env_\build\flutter\build\cpython-3.12.9+20250205-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz to
c:\pro_env_\build\flutter\build\build_python_3.12.9
[01:15:08] VERBOSE: c:\pro_env_\build\flutter\build\build_python_3.12.9\python\python.exe -m pip install --upgrade
--disable-pip-version-check --only-binary :all: --extra-index-url https://pypi.flet.dev --target
c:\pro_env_\build\site-packages\arm64-v8a flet==0.80.1
[01:15:19] VERBOSE: Looking in indexes: https://pypi.org/simple, https://pypi.flet.dev
[01:15:31] VERBOSE: Collecting flet==0.80.1
VERBOSE: Using cached flet-0.80.1-py3-none-any.whl.metadata (6.8 kB)
[01:15:33] VERBOSE: Collecting oauthlib>=3.2.2 (from flet==0.80.1)
VERBOSE: Using cached oauthlib-3.3.1-py3-none-any.whl.metadata (7.9 kB)
[01:15:35] VERBOSE: Collecting httpx>=0.28.1 (from flet==0.80.1)
VERBOSE: Using cached httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB)
[01:15:38] VERBOSE: Collecting repath>=0.9.0 (from flet==0.80.1)
VERBOSE: Using cached repath-0.9.0-py3-none-any.whl.metadata (899 bytes)
[01:15:44] VERBOSE: Collecting msgpack>=1.1.0 (from flet==0.80.1)
( ● ) Packaging Python app...

Activity

  1. changed the title [-]bug:Why does Python use Flet to build an APK? The process of "Packaging Python app..." remains unchanged.[/-] [+]bug:Why does Python use Flet to build an APK, The process of "Packaging Python app..." remains unchanged?[/+] on Jan 15, 2026
  2. changed the title [-]bug:Why does Python use Flet to build an APK, The process of "Packaging Python app..." remains unchanged?[/-] [+]bug:Python use Flet to build an APK,Why have it stopped at "Packaging Python app..." Here, there is no change.[/+] on Jan 15, 2026
  3. changed the title [-]bug:Python use Flet to build an APK,Why have it stopped at "Packaging Python app..." Here, there is no change.[/-] [+]bug:Python use Flet to build an APK,Why have it stopped at "Packaging Python app..." Here, there is no change?[/+] on Jan 15, 2026
  4. jinhong-china commented on Feb 7, 2026

    @jinhong-china

    I also encountered the same problem, why didn't the official answer Will this project continue to be maintained

  5. ndonkoHenri commented on Oct 7, 2026

    @ndonkoHenri
    Contributor

    Thanks for the detailed -vv log, and sorry for the late reply. This is the same hang we're tracking in #5013 (see also #5989 and #5507), so I'm closing this one as a duplicate. Please follow #5013 for updates.

    What's happening: msgpack is the first package in your log that isn't already in pip's cache, and its Android wheel comes from https://pypi.flet.dev, which redirects the actual download to gemfury.s3-accelerate.dualstack.amazonaws.com. When that host is blocked or very slow on your network, pip prints retry warnings. The packaging step doesn't read those warnings while pip is running, so pip gets stuck and flet build sits on "Packaging Python app..." forever instead of failing with the network error. We're working on a fix so this fails quickly and shows pip's actual error.

    Until then, to confirm the cause and work around it:

    1. Copy the ...\python.exe -m pip install ... command from your -vv output and run it in a terminal. You'll see the real error (timeouts, SSL errors, etc.) instead of a hang.
    2. Make sure both https://pypi.flet.dev and https://gemfury.s3-accelerate.dualstack.amazonaws.com are reachable from that machine. If you need a proxy, set HTTPS_PROXY (and HTTP_PROXY) in the same terminal before running flet build apk, because pip picks those up.
    3. Or build in CI with the official GitHub Action: https://flet.dev/docs/publish#github-actions

    @jinhong-china: yes, Flet is actively maintained (Flet 1.0 shipped in September). If you still hit this on the latest Flet after checking the steps above, please add your -vv log to #5013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions