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

Activate error versions for Gradle, Java, AGP, and KGP #142653

Open
gmackall opened this issue Jan 31, 2024 · 5 comments
Open

Activate error versions for Gradle, Java, AGP, and KGP #142653

gmackall opened this issue Jan 31, 2024 · 5 comments
Assignees
Labels
P2 Important issues not at the top of the work list t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@gmackall
Copy link
Member

When #142000 lands, we will have warning versions enabled for each of these dependencies. This is a tracking issue for activating the corresponding "error" version for each dependency, which should be done after the warnings have been active for a full release.

@gmackall gmackall added team-android Owned by Android platform team t: gradle "flutter build" and "flutter run" on Android labels Jan 31, 2024
@reidbaker reidbaker added P2 Important issues not at the top of the work list triaged-android Triaged by Android platform team labels Feb 8, 2024
@camsim99
Copy link
Contributor

Note that this will impact the flutter/packages test that builds the legacy all_packages app. I see the following when I try to build it:

Warning: Flutter support for your project's Android Gradle Plugin version (4.1.0) will soon be dropped. Please upgrade your Android Gradle Plugin version to a version of at least 7.0.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 the plugins block of the `settings.gradle` file (/Users/.../packages/legacy/all_packages/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 (/Users/.../packages/legacy/all_packages/android/build.gradle) by the following line in the dependencies block of the buildscript: "classpath 'com.android.tools.build:gradle:<version>'".
Warning: unable to detect project KGP version. Skipping version checking. 
This may be because you have applied KGP after the Flutter Gradle Plugin.

@gmackall
Copy link
Member Author

Note that this will impact the flutter/packages test that builds the legacy all_packages app. I see the following when I try to build it:

Warning: Flutter support for your project's Android Gradle Plugin version (4.1.0) will soon be dropped. Please upgrade your Android Gradle Plugin version to a version of at least 7.0.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 the plugins block of the `settings.gradle` file (/Users/.../packages/legacy/all_packages/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 (/Users/.../packages/legacy/all_packages/android/build.gradle) by the following line in the dependencies block of the buildscript: "classpath 'com.android.tools.build:gradle:<version>'".
Warning: unable to detect project KGP version. Skipping version checking. 
This may be because you have applied KGP after the Flutter Gradle Plugin.

Thanks, I'll need to make sure to update that test before turning this error on

@camsim99
Copy link
Contributor

Thanks, I'll need to make sure to update that test before turning this error on

Now that I think about it, in theory, that legacy app should only need to use the lower bound of the version dependencies that we support now versus those based on whatever much older Flutter version was chosen!

@gmackall
Copy link
Member Author

gmackall commented Mar 13, 2024

Collecting a list of things that will be unblocked when we activate these error versions:

@omarhr-001

This comment was marked as off-topic.

auto-submit bot pushed a commit that referenced this issue Jun 18, 2024
…0, and Fix test failures blocking androidx upgrade (#149204)

PR to pave the way for flutter/engine#53001 to re-land

Summary: 
- Enforces use of Kotlin >= `1.7.0` (please see below note)
- Fixes ci failures that prevented the above PR from landing.

Details:

Because it landed initially, we are able to fake the roll in this PR to fix all the tests ([see my comment](#149204 (comment))).

Fixes all the tests that failed:
1. `module_test` failing on multiple platforms (3/9 of the failures). 
Failure is 
```
> Android resource linking failed
   ERROR:/b/s/w/ir/x/t/flutter_module_test.KECMXW/hello/.android/plugins_build_output/device_info/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.
```

This is a rather unhelpful error message but some [folks online suggest](https://stackoverflow.com/a/69050529) that upgrading your `compileSdk` version fixes this.
These resolve when I remove the dependency on the long discontinued [package_info](https://pub.dev/packages/package_info) and [device_info](https://pub.dev/packages/device_info) packages, perhaps because they are transitively pulling in low `compileSdk` versions? This is unclear to me.

2. `module_custom_host_app_name_test` was failing for the same reason (another 3/9, or cumulative 6/9).
3. `tool_integration_tests_3_4` was a flake � (7/9)
4. `framework_tests_slow` needed a newer version of the Kotlin Gradle plugin (the flutter tool tells us this, so I just upgraded as suggested) and it resolved (8/9)
5.`android_preview_tool_integration_tests` needed newer AGP and KGP versions. I also refactored the tests, and bumped our error versions, fixing #142653.

**Note that the bump to KGP is not in line with our policy** - we didn't warn for `1.5.0-1.6.x` for a release (or at all) before dropping support. But I think it might still be justified:
- The bump to our androidx libraries unblocks ongoing Scribe work, and also includes a fix for a [memory leak](#129307 (comment)) and a [crash on folding phones](#114868 (comment)), among many other bug fixes.
- Gradle [doesn't test on half of that range](https://docs.gradle.org/current/userguide/compatibility.html#kotlin), and so we implicitly can't claim to support it either. More generally, our Java and Kotlin support ranges should probably strictly fall within what Gradle tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important issues not at the top of the work list t: gradle "flutter build" and "flutter run" on Android team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

4 participants