Stacked-Org / stacked

A Flutter application architecture created from real world scenarios
MIT License
978 stars 254 forks source link

[bug]: [stacked_themes] Incompatibility with AGP8 #1123

Open undead-reaper opened 2 months ago

undead-reaper commented 2 months ago

Describe the bug

Here's the error from VS Code: `Launching lib\main.dart on Pixel 7 Pro in debug mode...

FAILURE: Build failed with an exception.

If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

BUILD FAILED in 2s Error: Gradle task assembleDebug failed with exit code 1 `

What operating system do you use?

Windows

Information about the installed tooling

[!] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.22631.4112], locale en-US) • Flutter version 3.24.2 on channel stable at C:\Users\User\fvm\default ! Warning: flutter on your path resolves to C:\Users\User\fvm\versions\stable\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\User\fvm\default. Consider adding C:\Users\User\fvm\default\bin to the front of your path. ! Warning: dart on your path resolves to C:\Users\User\fvm\versions\stable\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\User\fvm\default. Consider adding C:\Users\User\fvm\default\bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4cf269e36d (6 days ago), 2024-09-03 14:30:00 -0700 • Engine revision a6bd3f1de1 • Dart version 3.5.2 • DevTools version 2.37.2 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) • Android SDK at C:\Users\User\AppData\Local\Android\sdk • Platform android-35, build-tools 35.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105) • All Android licenses accepted.

[✓] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✗] Visual Studio - develop Windows apps ✗ Visual Studio not installed; this is necessary to develop Windows apps. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components

[✓] Android Studio (version 2024.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0--11609105)

[✓] VS Code (version 1.93.0) • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.96.0

[✓] Connected device (4 available) • Pixel 7 Pro (mobile) • 31031FDH3000Y5 • android-arm64 • Android 15 (API 35) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4112] • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.120 • Edge (web) • edge • web-javascript • Microsoft Edge 128.0.2739.54

[✓] Network resources • All expected network resources are available.

! Doctor found issues in 2 categories.

Steps to reproduce the issue

  1. Add stacked_themes to a Flutter app dependencies.
  2. Try to run the app using flutter run.

Expected behavior

The app should run like usual.

Screenshots

No response

Additional Context

No response

sebastianbuechler commented 2 months ago

Maybe a stupid question,but have you tried the mentioned fix in your error message?

"If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant."

Also, the steps to reproduce the issue are not reproducing the issue.

undead-reaper commented 2 months ago

Yep I did try the mentioned fix but it's still not working, I even tried downgrading the gradle version but then I get other errors. And did you try to create the project on the flutter version I specified? Because I'm having this issue even on a completely blank and new app. Also I do have the namespace value in my flutter project and it's building fine without stacked_themes, it's only when I add it as a dependency that I get the error

FilledStacks commented 1 month ago

@undead-reaper

That is a problem with the statusbar package, it's not been properly maintained for a while.

I'll add this to the list, not high priority so I might not get to it soon.

I'd say you can roll your own themese setup for now, I'm simply using sharedPReferences + provider to manage themese locally.

bdairy commented 1 month ago

Same issue here,, My app is running and got updated,, with the statusbar package issue,,, any plan to fix soon? Thanks