From 2c185a48631bb5498c0d5dda782c5c4414bfdc64 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Sun, 29 Nov 2026 09:24:01 -0700 Subject: [PATCH 1/2] Give each Android download task its own ETag cache The downloadDistArchive_ and downloadDartBridge_ tasks all used useETag("all") with gradle-download-task's default cache file, download-task/etags.json. The plugin (5.6.0) truncates and rewrites that file with a PrintWriter after every download and parses it with JsonSlurper before each one, under a lock that belongs to a single task. Download tasks submit their work through the Worker API, so Gradle runs them concurrently within the project, and a task could parse a file another task was rewriting: Execution failed for task ':serious_python_android:downloadDistArchive_x86_64' > Unable to determine the current character, it is not a string, number, array, or object It shows up on a cold download cache (~/.flet/cache or FLET_CACHE_DIR), where all six files are fetched. With Flutter 3.50.1 (AGP 9.3.1, Gradle 9.5.0) every Android `flet build` job in flet's CI failed this way. Locally, the six tasks from an empty cache failed 2 runs in 10. Each task now keeps its ETags in download-task/.etags.json. Conditional downloads still work: a second run sends the stored ETag and leaves the cached archive untouched. Verified with a `flet build` project on Flutter 3.50.1 pointed at this package: 20 of 20 cold runs of the six tasks passed, and assembleRelease built the APK. --- src/serious_python_android/android/build.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index cfabf3d2..42aa884f 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -243,6 +243,10 @@ for (abi in abis) { dest(distFile) onlyIfModified(true) useETag("all") + // Each Download task keeps its own ETag cache. They run concurrently + // (Worker API) and the plugin rewrites a shared etags.json without a + // cross-task lock, so a task could parse another's half-written file. + cachedETagsFile(layout.buildDirectory.file("download-task/$name.etags.json")) tempAndMove(true) doFirst { distFile.parentFile.mkdirs() } } @@ -406,6 +410,7 @@ for (abi in abis) { dest(bridgeFile) onlyIfModified(true) useETag("all") + cachedETagsFile(layout.buildDirectory.file("download-task/$name.etags.json")) tempAndMove(true) doFirst { bridgeFile.parentFile.mkdirs() } } From ba772f21116be464fd84aa07518cbdd0ece0975c Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Sun, 29 Nov 2026 09:26:03 -0700 Subject: [PATCH 2/2] Bump to 6.1.4 --- src/serious_python/CHANGELOG.md | 4 ++++ .../example/flask_example/pubspec.lock | 12 ++++++------ src/serious_python/example/run_example/pubspec.lock | 12 ++++++------ src/serious_python/pubspec.yaml | 2 +- src/serious_python_android/CHANGELOG.md | 4 ++++ src/serious_python_android/android/build.gradle.kts | 2 +- src/serious_python_android/pubspec.yaml | 2 +- src/serious_python_darwin/CHANGELOG.md | 4 ++++ .../darwin/serious_python_darwin.podspec | 2 +- src/serious_python_darwin/pubspec.yaml | 2 +- src/serious_python_linux/CHANGELOG.md | 4 ++++ src/serious_python_linux/pubspec.yaml | 2 +- src/serious_python_platform_interface/CHANGELOG.md | 4 ++++ src/serious_python_platform_interface/pubspec.yaml | 2 +- src/serious_python_windows/CHANGELOG.md | 4 ++++ src/serious_python_windows/pubspec.yaml | 2 +- 16 files changed, 44 insertions(+), 20 deletions(-) diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index 64af9b2d..0d22d12c 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Fix Android builds failing with "Unable to determine the current character, it is not a string, number, array, or object" in `downloadDistArchive_` or `downloadDartBridge_` when the download cache is empty: the download tasks run concurrently and shared one ETag cache file, so a task could read it while another was rewriting it. Each task now keeps its own ETag cache ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Fix the `package` command hiding why a step failed when the error went to stdout, such as the `SyntaxError` from compiling an app file, which made `flet build` fail with no explanation unless run with `-vv` ([#262](https://github.com/flet-dev/serious-python/pull/262), [flet-dev/flet#7029](https://github.com/flet-dev/flet/issues/7029)). diff --git a/src/serious_python/example/flask_example/pubspec.lock b/src/serious_python/example/flask_example/pubspec.lock index 1d96d94a..0fe09cf3 100644 --- a/src/serious_python/example/flask_example/pubspec.lock +++ b/src/serious_python/example/flask_example/pubspec.lock @@ -361,42 +361,42 @@ packages: path: "../.." relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_android: dependency: transitive description: path: "../../../serious_python_android" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_darwin: dependency: transitive description: path: "../../../serious_python_darwin" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_linux: dependency: transitive description: path: "../../../serious_python_linux" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_platform_interface: dependency: transitive description: path: "../../../serious_python_platform_interface" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_windows: dependency: transitive description: path: "../../../serious_python_windows" relative: true source: path - version: "6.1.3" + version: "6.1.4" shelf: dependency: transitive description: diff --git a/src/serious_python/example/run_example/pubspec.lock b/src/serious_python/example/run_example/pubspec.lock index eadfc03a..7dc1dfd5 100644 --- a/src/serious_python/example/run_example/pubspec.lock +++ b/src/serious_python/example/run_example/pubspec.lock @@ -384,42 +384,42 @@ packages: path: "../.." relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_android: dependency: transitive description: path: "../../../serious_python_android" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_darwin: dependency: transitive description: path: "../../../serious_python_darwin" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_linux: dependency: transitive description: path: "../../../serious_python_linux" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_platform_interface: dependency: transitive description: path: "../../../serious_python_platform_interface" relative: true source: path - version: "6.1.3" + version: "6.1.4" serious_python_windows: dependency: transitive description: path: "../../../serious_python_windows" relative: true source: path - version: "6.1.3" + version: "6.1.4" shelf: dependency: transitive description: diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index 3d964fbe..4e2ec691 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 platforms: ios: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index c98d2e7c..f3737096 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Fix Android builds failing with "Unable to determine the current character, it is not a string, number, array, or object" in `downloadDistArchive_` or `downloadDartBridge_` when the download cache is empty: the download tasks run concurrently and shared one ETag cache file, so a task could read it while another was rewriting it. Each task now keeps its own ETag cache ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Align with the serious_python **6.1.3** release ([#262](https://github.com/flet-dev/serious-python/pull/262)). diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index 42aa884f..43e28a8e 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -21,7 +21,7 @@ buildscript { } group = "com.flet.serious_python_android" -version = "6.1.3" +version = "6.1.4" rootProject.allprojects { repositories { diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index f02e9fcd..7609de0d 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index 8b3b42fc..abcd6688 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Align with the serious_python **6.1.4** release ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Align with the serious_python **6.1.3** release ([#262](https://github.com/flet-dev/serious-python/pull/262)). diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index 2ab1ab39..a7bd2c82 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '6.1.3' + s.version = '6.1.4' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index d1ba8953..9f592d7c 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 environment: # The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index d363fbbf..deccbfed 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Align with the serious_python **6.1.4** release ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Align with the serious_python **6.1.3** release ([#262](https://github.com/flet-dev/serious-python/pull/262)). diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index 297e51cd..76f6e133 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index e43dec06..b5ec01f4 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Align with the serious_python **6.1.4** release ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Align with the serious_python **6.1.3** release ([#262](https://github.com/flet-dev/serious-python/pull/262)). diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index dbfae227..75c2719a 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index fd07b6e3..0d668f8a 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.1.4 + +* Align with the serious_python **6.1.4** release ([#264](https://github.com/flet-dev/serious-python/pull/264)). + ## 6.1.3 * Align with the serious_python **6.1.3** release ([#262](https://github.com/flet-dev/serious-python/pull/262)). diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index fcc007e1..ba6890cd 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 6.1.3 +version: 6.1.4 environment: sdk: '>=3.1.3 <4.0.0'