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

LTS version of the Flutter package doesn't respect minimum Android SDK requirements #224

Closed
jozsefsallai opened this issue Nov 5, 2021 · 11 comments
Assignees
Labels
bug Something isn't working fixed-in-v4.5.1 flutter Affect flutter platform LTS Affects LTS releases v4.5 Affects v4.5 release

Comments

@jozsefsallai
Copy link

Description
Adding the LTS version of the ffmpeg_kit_flutter package seems to result in broken behavior in terms of minimum SDK requirements on Android.

Expected behavior
App builds fine for the minimum SDK version required by the LTS version of the package.

Current behavior
Android build fails due to the SDK version not being 24, despite the readme specifying 16.

To Reproduce
Here's a reproduction repo: https://github.com/jozsefsallai/flutter-ffmpeg-kit-lts-repro

Environment

  • Platform: Flutter/Android
  • Architecture: arm64
  • Version: 4.5.0-LTS

Other
I've also tried:

  • flutter pub cache clean && flutter pub get
  • rm -rf build && rm -rf android/.gradle

After checking the cached package, I noticed that:

  • the package's pubspec specifies 4.5.0-LTS, so the correct package was installed

image

  • despite that, the build.gradle from the package still has a hard requirement for SDK ver 24

image

I think it's also worth noting that adding ffmpeg_kit_flutter: ^4.5.0-LTS to pubspec.yaml actually installed 4.5.0 (non-LTS) regardless, so I had to manually edit pubspec.lock to get the right version to install.

@tanersener
Copy link
Collaborator

tanersener commented Nov 5, 2021

Yeah, sorry for that. Can you use the development-flutter branch until we release the fix? It was fixed there.

And, any suggestions for the ffmpeg_kit_flutter: ^4.5.0-LTS issue?

@tanersener tanersener added bug Something isn't working flutter Affect flutter platform LTS Affects LTS releases v4.5 Affects v4.5 release duplicate This issue or pull request already exists labels Nov 5, 2021
@tanersener tanersener removed the duplicate This issue or pull request already exists label Nov 5, 2021
@jozsefsallai
Copy link
Author

Unfortunately, using the development-flutter branch doesn't seem to fix the issue for me, probably because of this line:

https://github.com/tanersener/ffmpeg-kit/blob/b5c7a0c157aca0ed9af606fb82eff0b8a4cb74dc/flutter/flutter/android/build.gradle#L18

The output is the same. In fact, this breaks builds on iOS too (but I assume that's because it doesn't see the -LTS suffix anywhere). I've created a new branch on my reproduction repo.

It's also very possible that I'm doing something wrong while adding the dependency, since I don't often import packages from git. It should look like this, right?

https://github.com/jozsefsallai/flutter-ffmpeg-kit-lts-repro/blob/7203eb122c6b4558442e5d5231f9bfcc39937e3d/pubspec.yaml#L32-L36

And, any suggestions for the ffmpeg_kit_flutter: ^4.5.0-LTS issue?

Not that I can think of, but I will try to investigate. Can't think of any logical explanation as to why this happens, so it's likely a bug in Dart. Right now the only workaround I've found is manually patching the version number in the lockfile.

@tanersener
Copy link
Collaborator

Unfortunately, using the development-flutter branch doesn't seem to fix the issue for me, probably because of this line:

There are 18 different flutter packages published by ffmpeg-kit. A single repo cannot have the source code of all packages. It includes only the default Main package. Not the LTS version.

For LTS versions and other packages, you can either manually edit those files and update the dependencies or create all packages by using the release script under the tools/release/flutter/create_packages.sh script.

@jozsefsallai
Copy link
Author

Ah, that's fair. I haven't really deep-dived into the source code so I wasn't aware how it was made/generated, sorry!

I will try modifying the package accordingly, thanks!

@tanersener tanersener added the fixed-on-development Fixed on the development branch. Not released yet. label Nov 7, 2021
@tanersener tanersener self-assigned this Nov 7, 2021
@shilangyu
Copy link

shilangyu commented Nov 16, 2021

And, any suggestions for the ffmpeg_kit_flutter: ^4.5.0-LTS issue?

Probably worth mentioning in the readme. Adding the -LTS suffix in the lock file and then running flutter pub get solves this issue, then both android and ios is able to detect that the LTS version is being used.

Also, in case it wasn't clear, I can confirm iOS minimum deployment target is being respected for LTS

@tanersener
Copy link
Collaborator

Thanks. I added this to the Tips. We can also put it to the project README on the next doc update.

@bdlukaa
Copy link

bdlukaa commented Nov 18, 2021

I also got this issue. A workaround can be:

<manifest xmlns:tools="http://schemas.android.com/tools" ....... >
    <uses-sdk tools:overrideLibrary="com.arthenica.ffmpegkit.flutter, com.arthenica.ffmpegkit" />
</manifest>

Don't forget to add xmlns:tools="http://schemas.android.com/tools"

@stonekase
Copy link

I also got this issue. A workaround can be:

<manifest xmlns:tools="http://schemas.android.com/tools" ....... >
    <uses-sdk tools:overrideLibrary="com.arthenica.ffmpegkit.flutter, com.arthenica.ffmpegkit" />
</manifest>

Don't forget to add xmlns:tools="http://schemas.android.com/tools"

This worked for me

@tanersener tanersener added fixed-in-v4.5.1 and removed fixed-on-development Fixed on the development branch. Not released yet. labels Jan 3, 2022
@tanersener
Copy link
Collaborator

Fixed in v4.5.1 release.

@rahulvyas
Copy link

I'm still having the same issue I want to use min LTS and I've tried different pubspec entries but no luck... Any idea how I can use that? I only want to use conversion to MP4 without using x264, and x265. Which line should I add into pubspec file? I've tried with this (ffmpeg_kit_flutter_min: ^4.5.1-LTS)

@shilangyu
Copy link

You can't use the caret when specifying the LTS version, as semver will upgrade your dependency to the non-LTS version (which is considered newer). Specify your LTS version as an exact one and check pubspec.lock whether the correct version was downloaded (you can check that currently your lock file most likely points to the non-LTS version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-in-v4.5.1 flutter Affect flutter platform LTS Affects LTS releases v4.5 Affects v4.5 release
Projects
None yet
Development

No branches or pull requests

6 participants