From 68f3727168b90707b7bfcf911be525319fe7cdfc Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Tue, 16 Dec 2025 15:51:19 -0800 Subject: [PATCH] 0.70.0 android crash fix (#60) * Update serious_python dependency ref Changed the git reference for serious_python from 'android-crash-fix' to 'android10-fix' in pubspec.yaml to use the latest fix. * Update serious_python dependency ref Changed the git reference for serious_python from 'android10-fix' to 'android-crash-fix' in pubspec.yaml to use the latest fix for Android crashes. * Update serious_python dependency ref in pubspec.yaml Changed the git ref for serious_python from 'android-crash-fix' to 'android10-fix' to use the updated branch. * Add random suffix to UDS socket filename Appends a random 8-character string to the Unix Domain Socket filename to avoid potential conflicts when multiple instances are running. Introduces a helper function for generating random strings. * Revert "Add random suffix to UDS socket filename" This reverts commit bcff44e8e136cceaafa527de0bb95e06d51e9303. * Comment out debugPrint override in release mode The line that disables debugPrint in release mode has been commented out, allowing debug messages to be printed even in release builds. This may be for troubleshooting or to temporarily enable logging. * Fix UDS path for FLET_SERVER_UDS_PATH environment variable Updated the UDS path assignment to use the full path by joining appTempPath and the socket filename. This ensures the environment variable points to the correct socket location. * Fix UDS path assignment for non-Windows platforms Corrects the construction of the Unix Domain Socket path by joining the temp directory and socket filename, ensuring the environment variable and pageUrl are set consistently. * Enable debugPrint suppression in release mode Uncommented the line that suppresses debugPrint output when not in debug mode and in release builds. Also updated socket address generation to use a temporary storage path from environment variables for non-TCP output. * Fix null safety issue with environment variable access Added a non-null assertion operator to ensure 'FLET_APP_STORAGE_TEMP' is not null when constructing the socket address path. --- {{cookiecutter.out_dir}}/lib/main.dart | 4 ++-- {{cookiecutter.out_dir}}/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.out_dir}}/lib/main.dart b/{{cookiecutter.out_dir}}/lib/main.dart index 02b0d80..366c691 100644 --- a/{{cookiecutter.out_dir}}/lib/main.dart +++ b/{{cookiecutter.out_dir}}/lib/main.dart @@ -193,7 +193,7 @@ Future prepareApp() async { environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString(); } else { // use UDS on other platforms - pageUrl = "flet_$pid.sock"; + pageUrl = path.join(appTempPath, "flet_$pid.sock"); environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl; } } @@ -222,7 +222,7 @@ Future runPythonApp(List args) async { 'Python output TCP Server is listening on port ${outSocketServer.port}'); socketAddr = "$tcpAddr:${outSocketServer.port}"; } else { - socketAddr = "stdout_$pid.sock"; + socketAddr = path.join(environmentVariables["FLET_APP_STORAGE_TEMP"]!, "stdout_$pid.sock"); if (await File(socketAddr).exists()) { await File(socketAddr).delete(); } diff --git a/{{cookiecutter.out_dir}}/pubspec.yaml b/{{cookiecutter.out_dir}}/pubspec.yaml index 249abb9..5c56d8c 100644 --- a/{{cookiecutter.out_dir}}/pubspec.yaml +++ b/{{cookiecutter.out_dir}}/pubspec.yaml @@ -45,7 +45,7 @@ dependency_overrides: serious_python: git: url: https://github.com/flet-dev/serious-python.git - ref: android-crash-fix + ref: android10-fix path: src/serious_python package_info_plus: ^9.0.0