Skip to content

Conversation

@camsim99
Copy link
Contributor

@camsim99 camsim99 commented Oct 27, 2025

Reverts #177255. This pull request was to the wrong branch. Should have been flutter-3.38-candidate.0.

@camsim99 camsim99 requested a review from a team as a code owner October 27, 2025 17:59
@flutter-dashboard
Copy link

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 27, 2025
@camsim99 camsim99 requested a review from reidbaker October 27, 2025 18:01
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request reverts a previous revert, re-introducing the logic to resolve native Flutter dependencies in Android Studio. This is achieved by adding compileOnly dependencies for debug builds when the Gradle task is invoked from the IDE. The changes look reasonable, but I have a couple of suggestions for improvement regarding maintainability and error handling.

Comment on lines +347 to 349
} catch (e: TaskInstantiationException) {
// ignored
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Silently ignoring exceptions is generally not a good practice. If this TaskInstantiationException is caught, it would be beneficial to log it to inform developers about what happened. This would be helpful for debugging purposes, for instance, if the task registration is skipped when it wasn't intended to be.

Consider adding a log message, for example, at the info level.

Suggested change
} catch (e: TaskInstantiationException) {
// ignored
}
} catch (e: TaskInstantiationException) {
rootProject.logger.info("The 'generateLockfiles' task is already registered. Skipping.", e)
}

Comment on lines +833 to +836
dependencies.add("compileOnly", "io.flutter:flutter_embedding_debug:$engineVersion")
dependencies.add("compileOnly", "io.flutter:armeabi_v7a_debug:$engineVersion")
dependencies.add("compileOnly", "io.flutter:arm64_v8a_debug:$engineVersion")
dependencies.add("compileOnly", "io.flutter:x86_64_debug:$engineVersion")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid hardcoding the list of architectures, you can iterate over FlutterPluginConstants.DEFAULT_PLATFORMS to add these dependencies. This would be more consistent with how other parts of the codebase handle platform-specific dependencies and would make it easier to add or remove architectures in the future.

            dependencies.add("compileOnly", "io.flutter:flutter_embedding_debug:$engineVersion")
            FlutterPluginConstants.DEFAULT_PLATFORMS.forEach { platform ->
                val arch = FlutterPluginConstants.PLATFORM_ARCH_MAP[platform]?.replace("-", "_")
                dependencies.add("compileOnly", "io.flutter:${arch}_debug:$engineVersion")
            }

Copy link
Member

@jtmcdole jtmcdole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the revert of the revert. Long live the first one.

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2025
@auto-submit auto-submit bot merged commit 5397ea8 into flutter-3.37-candidate.0 Oct 28, 2025
147 checks passed
@auto-submit auto-submit bot deleted the revert-177255-cp-beta-eb325fcea0056ad5219a9ef39d4f46e689c2958c branch October 28, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants