-
Notifications
You must be signed in to change notification settings - Fork 0
Merge Android crash fix into the main branch #7
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
Conversation
…cy (flet-dev#185) * Fix leading dash in framework identifier generation Ensures that any leading dashes are removed from the generated framework identifier in xcframework_utils.sh. Defaults to 'framework' if the identifier is empty after processing. * Update CFBundlePackageType to FMWK in plist generation Changed the CFBundlePackageType from 'APPL' to 'FMWK' in the create_plist function to correctly identify the bundle as a framework. Also made a minor whitespace adjustment in create_xcframework_from_dylibs. * Bump `archive` dependency to `^4.0.7` (flet-dev#184) * update `archive` dependency to ``^4.0.7` and bump serious_python version to `0.9.5` * revert flutter_lints dependency to version 2.0.0 * Bump version to 0.9.5 for Android and Darwin Updated the version number to 0.9.5 in both the Android build.gradle and Darwin podspec files to prepare for a new release. --------- Co-authored-by: Feodor Fitsner <feodor@appveyor.com> * Update changelogs for iOS framework identifier fix Added notes to all package changelogs for version 0.9.5 about the fix for iOS framework identifier generation. --------- Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com>
* Make zipDirectory call asynchronous Added 'await' to the zipDirectory method to ensure the archive creation completes before proceeding. This change improves reliability when creating app archives. * Bump to 0.9.6 and make zipDirectory asynchronous Updated all platform packages to version 0.9.6. The zipDirectory call is now asynchronous across all implementations for improved performance and consistency.
Refactored the setenv function to return a Future<void> and updated all calls to setenv to use await. This ensures environment variables are set in the correct order before proceeding.
Introduces a guard to prevent repeated initialization and finalization of the CPython interpreter, addressing crashes on second launch with CPython 3.12. Also ensures the current native thread is registered with the GIL when running Python code, improving stability when re-entering Python from new Dart isolates or threads.
Updated the debugPrint statement to remove the 'Warning:' prefix when unable to load libpyjni.so. This change streamlines log output for consistency.
This reverts commit 3f4adc0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR merges an Android crash fix into the main branch by updating Python from version 3.12/3.14.0 to 3.14.2 and fixing a critical race condition in environment variable initialization.
Key changes:
- Upgraded Python to 3.14.2 across Android and Windows platforms with updated build configurations and generated bindings
- Fixed async/await race condition in Android initialization by properly awaiting all environment variable setenv calls, which was likely causing crashes
- Raised Android minimum API level from 21 to 24 (Android 5.0 → 7.0) as part of the Python 3.14.2 requirements
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/serious_python_windows/windows/CMakeLists.txt | Updated Python download URL from v3.14 to v3.14.2 |
| src/serious_python_android/python_ffigen.yaml | Updated FFI generation paths from python3.12 to python3.14 headers |
| src/serious_python_android/lib/src/gen.dart | Updated generated Python constants: version 3.12.3/3.14.0 → 3.14.2, version hex, and Android API level 21 → 24 |
| src/serious_python_android/lib/serious_python_android.dart | Fixed crash by adding await keywords to all setenv() calls and refactored setenv() to use arrow syntax; removed "Warning:" prefix from error message |
| src/serious_python_android/android/build.gradle | Updated python_version variable from '3.14' to '3.14.2' |
| src/serious_python/bin/package_command.dart | Updated build Python version from 3.14.0 to 3.14.2 and release date from 20251007 to 20251209 |
Comments suppressed due to low confidence (1)
src/serious_python_windows/windows/CMakeLists.txt:25
- This CMake script downloads a prebuilt Python runtime from
PYTHON_URLusingfile(DOWNLOAD)and immediately extracts it without any integrity verification. If the GitHub release or network path is compromised, a malicious zip could be pulled into your build and bundled into the shipped application, leading to arbitrary code execution in the build environment and on end-user systems. To mitigate this, add strong integrity checks (such as anEXPECTED_HASHor signature verification) and pin the download to an immutable, verified artifact before extracting and using it.
set(PYTHON_URL "https://github.com/cfms-dev/python-build/releases/download/v3.14.2/python-windows-for-dart-3.14.2.zip")
set(PYTHON_FILE ${CMAKE_BINARY_DIR}/python-windows-for-dart.zip)
if (NOT EXISTS ${PYTHON_FILE})
file(DOWNLOAD ${PYTHON_URL} ${PYTHON_FILE})
file(ARCHIVE_EXTRACT INPUT ${PYTHON_FILE} DESTINATION ${PYTHON_PACKAGE})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.