0

When building a flet apk through

flet build apk --include-package requests,

the flutter compiler fails with the following error.

Because flet 0.25.2 depends on http ^1.2.2 and requests >=4.1.0 depends on http ^0.13.4, flet 0.25.2 is incompatible with requests >=4.1.0. And because requests <4.1.0 doesn't support null safety, flet 0.25.2 is incompatible with requests. So, because urenregistratie depends on both flet 0.25.2 and requests any, version solving failed.

The lower bound of "sdk: '>=2.0.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety

  • Flet version => 0.25.2
  • Flutter version => 3.24.5
  • Dart version => 3.5.4

the following ive tried:

  • downgrading flutter and dart
  • downgrading flet
  • upgrading flutter packages

2 Answers 2

0

--include-packages is not meant for python packages, but instead Flutter packages. More info here.

To specify the requests package (or any other python dependency), you can create either a requirements.txt or pyproject.toml which contains your these. More info here. Example.

Sign up to request clarification or add additional context in comments.

Comments

0

You can add pure python packages using pyproject.toml which is created with your project folder. Here's what it should look like -

dependencies = [
  "flet==0.28.3",
  "flet-webview==0.1.0",
  "pandas==2.2.3", # Pandas is not a pure package but is already hosted on pypi.flet.dev hence we need to specify the version
  "websocket-client", # Pure Python package
  "requests" # Pure Python package
]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.