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

[flutter_sound] SDK Version issue #2

Open
MatheusTraldi opened this issue Jan 18, 2025 · 2 comments
Open

[flutter_sound] SDK Version issue #2

MatheusTraldi opened this issue Jan 18, 2025 · 2 comments

Comments

@MatheusTraldi
Copy link

MatheusTraldi commented Jan 18, 2025

[flutter_sound: ^9.19.1]

After installing the package, the Android build crashes with the error:

C:\Users\mathe\musical_leds_controller\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [:flutter_sound] C:\Users\mathe\musical_leds_controller\build\flutter_sound\intermediates\merged_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 21
Suggestion: use a compatible library with a minSdk of at most 21,
or increase this project's minSdk version to at least 24,
or use tools:overrideLibrary="xyz.canardoux.fluttersound" to force usage (may lead to runtime failures)

I can't find a valid way to overcome it. What's a good suggestion, please?

@MatheusTraldi MatheusTraldi changed the title SDK Version issue SDK Version issue [flutter_sound] Jan 18, 2025
@MatheusTraldi MatheusTraldi changed the title SDK Version issue [flutter_sound] [flutter_sound] SDK Version issue Jan 18, 2025
@Larpoux
Copy link
Contributor

Larpoux commented Jan 18, 2025

Tau is not yet released.
Flutter Sound needs at least minSdk 24 on Android.
You should switch to Flutter Sound plugin and update your minSdkVersion parameter in file app/build.gradle
You can look to this example

@MatheusTraldi
Copy link
Author

MatheusTraldi commented Jan 18, 2025

Thanks for the answer.

I got it running. I will post here the steps I took to update the Android SDK for those who don't know how to do it (like me).

Steps:

  1. In ./android/app/build.gradle file:

    defaultConfig {
        // ...
        minSdkVersion 24 // add this
        // ...
    }
  2. In the terminal:

    flutter clean
    flutter pub get
    flutter run

The flutter run is very important. Just start debugging with something like the Start button in Visual Studio doesn't install the update.

There is a current bug when updating like this. Flutter will prompt a solution, which involves modifying a variable in a specific file.

Repeat in the terminal after that:

```bash
flutter clean
flutter pub get
flutter run
```

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

2 participants