Apparence-io / quick_settings

A Flutter plugin to manage a custom Tile in Quick Settings
https://pub.dev/packages/quick_settings
MIT License
18 stars 4 forks source link

Build failed #4

Closed thewh1teagle closed 1 year ago

thewh1teagle commented 1 year ago

I Tried to use this library by creating new flutter project, and then I installed it with

flutter pub add quick_settings

and added to main:

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  QuickSettings.setup(
    onTileClicked: null,
    onTileAdded: null,
    onTileRemoved: null,
  );
  runApp(const MyApp());
}

And then I got the following error:

Launching lib\main.dart on sdk gphone x86 64 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:

       1.  Dependency 'androidx.core:core:1.12.0-alpha04' requires libraries and applications that
           depend on it to compile against codename "UpsideDownCake" of the
           Android APIs.

           :app is currently compiled against android-33.

           Recommended action: Use a different version of dependency 'androidx.core:core:1.12.0-alpha04',
           or set compileSdkPreview to "UpsideDownCake" in your build.gradle
           file if you intend to experiment with that preview SDK.

       2.  Dependency 'androidx.core:core-ktx:1.12.0-alpha04' requires libraries and applications that
           depend on it to compile against codename "UpsideDownCake" of the
           Android APIs.

           :app is currently compiled against android-33.

           Recommended action: Use a different version of dependency 'androidx.core:core-ktx:1.12.0-alpha04',
           or set compileSdkPreview to "UpsideDownCake" in your build.gradle
           file if you intend to experiment with that preview SDK.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 32s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Android version: 13 Flutter version: 3.10.0 OS: Windows 11 x64

apalala-dev commented 1 year ago

This problem was due to a newer version of androidx.core:core-ktx. quick_settings was using the + suffix, which means any new version would be used. I switched to the latest stable version instead. The fix is available on the 1.0.1 release.