Skip to content

[compass-app] Freezed package dependencies and AGP version errors #2725

@rafaelsnv

Description

@rafaelsnv

1) This happened after i added the folder compass_app/app to the root pubspec.yaml:

PS C:\Repos\samples> flutter pub get
Resolving dependencies... (1.2s)
Because compass_app depends on freezed_annotation ^2.4.4 and freezed >=3.1.0 depends on freezed_annotation 3.1.0, freezed >=3.1.0 is forbidden.
And because compass_app depends on freezed ^3.0.0 and freezed >=3.0.0 <3.2.0 depends on source_gen ^2.0.0, source_gen ^2.0.0 is required.      
So, because source_gen >=1.1.0 <3.0.0-dev depends on build ^2.1.0 and desktop_photo_search depends on build ^3.0.0, version solving failed.    
Failed to update packages.

Solved changing freezed_annotation: ^2.4.4 to freezed_annotation: ^3.0.0.


2) Then added compass_app/server to root pubspec.yaml:

PS C:\Repos\samples> flutter pub get
Resolving dependencies... 
Because compass_server depends on freezed ^2.5.7 and compass_app depends on freezed ^3.0.0, version solving failed.
Failed to update packages.

Solved changing freezed and freezed_annotation to ^3.0.0


3) At this time i got an error trying to run flutter run --target lib/main_development.dart

PS C:\Repos\samples\compass_app\app> flutter run --target lib/main_development.dart
Resolving dependencies in `C:\Repos\samples`...
...
Got dependencies in `C:\Repos\samples`!
Try `flutter pub outdated` for more information.
Launching lib/main_development.dart on sdk gphone64 x86 64 in debug mode...
Warning: Flutter support for your project's Gradle version (8.4.0) will soon be dropped. Please upgrade your Gradle version to a version of at least 8.7.0 soon.
Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Repos\samples\compass_app\app\android\app\build.gradle' line: 5

* What went wrong:
An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin']
> Failed to apply plugin 'dev.flutter.flutter-gradle-plugin'.
   > Error: Your project's Android Gradle Plugin version (Android Gradle Plugin version 8.1.0) is lower than Flutter's minimum supported version of Android Gradle Plugin version 8.1.1. Please upgrade your Android Gradle Plugin version.
     Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

     Potential fix: Your project's AGP version is typically defined in the plugins block of the `settings.gradle` file (C:\Repos\samples\compass_app\app\android/settings.gradle), by a plugin with the id of com.android.application.
     If you don't see a plugins block, your project was likely created with an older template version. In this case it is most likely defined in the top-level build.gradle file (C:\Repos\samples\compass_app\app\android/build.gradle) by the following line in the dependencies block

Solved changing com.android.application versionto 8.2.1 at app\android\settings.gradle


4) Finally could run the app but with some of deprecation warnings:

Launching lib/main_development.dart on sdk gphone64 x86 64 in debug mode...
Warning: Flutter support for your project's Gradle version (8.4.0) will soon be dropped. Please upgrade your Gradle version to a version of at least 8.7.0 soon.
Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

Potential fix: Your project's gradle version is typically defined in the gradle wrapper file. By default, this can be found at C:\Repos\samples\compass_app\app\android/gradle/wrapper/gradle-wrapper.properties.
For more information, see https://docs.gradle.org/current/userguide/gradle_wrapper.html.

Warning: Flutter support for your project's Android Gradle Plugin version (Android Gradle Plugin version 8.2.1) will soon be dropped. Please upgrade your Android Gradle Plugin version to a version of at least Android Gradle Plugin version 8.6.0 soon.
Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

Potential fix: Your project's AGP version is typically defined in the plugins block of the `settings.gradle` file (C:\Repos\samples\compass_app\app\android/settings.gradle), by a plugin with the id of com.android.application.
If you don't see a plugins block, your project was likely created with an older template version. In this case it is most likely defined in the top-level build.gradle file (C:\Repos\samples\compass_app\app\android/build.gradle) by the following line in the dependencies block of the buildscript: "classpath 'com.android.tools.build:gradle:<version>'".

Warning: Flutter support for your project's Kotlin version (1.8.22) will soon be dropped. Please upgrade your Kotlin version to a version of at least 2.1.0 soon.
Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

Potential fix: Your project's KGP version is typically defined in the plugins block of the `settings.gradle` file (C:\Repos\samples\compass_app\app\android/settings.gradle), by a plugin wiwarning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

5) Those warnings should be solved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions