Skip to content
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

APK Blank Screen from Missing libpythonbundle.so in Custom P4A Distro #84

Open
auphof opened this issue Apr 17, 2024 · 0 comments
Open

Comments

@auphof
Copy link

auphof commented Apr 17, 2024

With a custom P4A distro, the APK does not function on target device, produces blank screen.
There is no libpythonbundle.so in APK.

With a verbose build flet build apk -v --template-dir $HOME/example_helloflet/flet-build-template i observed build.sh issues with popd and pushd. . BUT the build is successful and will install and run, just producing a blank screen.

I am using a customized App template cloned from the Cookiecutter flet-build-template and custom P4A distro.

image

Expected Behavior:
Normal flow - The build process completes successfully without errors.
Exception flow - If an error occurs the Build should terminate with relevant errors.

Actual Behavior:
The build.sh script errors when executing popd and pushd, resulting in a libpythonbundle.so not being copied into the APK

Suggested fix
I believe all that is needed is to

  1. Updated Tag to capture commit regarding build.sh Get rid of pushd and popd due to issue #67 #69
  2. Possibly push new Tag to Flutter (Not familiar with Flutter Package Management)
  3. update the dependency in https://github.com/flet-dev/flet-build-template/blob/fed5d5fabcabf7ef1c7341acca406605150e5338/%7B%7Bcookiecutter.out_dir%7D%7D/pubspec.yaml#L14

Additional consideration

  1. Consider modification of build.sh that on exceptions to terminate the build with appropriate trace

Workaround
Alter the template pubspec.yaml to work with a local version of serious-python using minimum commit of f93ac86(e44dff1)

  1. clone https://github.com/flet-dev/serious-python into a local folder
  2. modify the template pubspec.yaml to use the local dependency replace serious_python: ^0.7.0 with
dependencies:
  flutter:
    sdk: flutter

  # serious_python: ^0.7.0
  serious_python:
    path: /modules/serious-python/src/serious_python

Steps to Reproduce:

  1. flet create example_helloflet
  2. Generate a P4A distro and then export SERIOUS_PYTHON_P4A_DIST=$HOME/.local/share/python-for-android/dists/mydist
  3. install the cookie cutter template git clone https://github.com/flet-dev/flet-build-template example_helloflet/flet-build-template
  4. Initiate the APK build using the flet-build-template
  5. Wait the Running Gradle task 'assembleRelease' and the Copying P4A libraries from /home/xxxx/.local/share/python-for-android/dists/mydist and the execution of the build.sh script. Observe the failure when popd and pushd commands are executed.

** Possible related issues **
#82

Environment:

  • OS: Ubuntu 22.04 in WSL2 on Windows 11
  • Target: Android, using standard settings as defined in serious-python
  • Python Version: 3.11.9
  • flet : 0.21.2
  • serious-python Module Version: 0.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant