Skip to content

Commit 04f9253

Browse files
authored
Update Android Studio version (#8565)
I removed code that seems to be related to making gradle files editable within a Flutter project window as the Android Studio code has changed. I will record some additional details in my internal notes. There were also test compilation failures that suggested the annotations library wasn't required correctly. (see https://stackoverflow.com/questions/62066166/string-notnull-syntax-causes-notnull-not-applicable-to-type-use-in-in - thanks @pq). When I asked gemini about this, it suggested that we were compiling production source code twice for tests, because the test source sets included `src` as well. I guess it turns out that this isn't needed and the dependency on the production source code is implied; additionally, compiling the production source during test is bad because it can be compiled in the wrong environment. I think this is documentation that includes this info if we want to investigate further at a later time: https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_source_sets
1 parent dddce13 commit 04f9253

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## Unreleased
1+
## 88.0.0
22

33
### Added
44

5+
- Support for Android Studio 2025.2
6+
57
### Removed
68

79
- The Flutter version is now read from the file ./bin/cache/flutter.version.json, required in Flutter 3.33+ (#8465)

build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ sourceSets {
152152
test {
153153
java.srcDirs(
154154
listOf(
155-
"src",
156-
"testSrc/unit",
157-
"third_party/vmServiceDrivers"
155+
"testSrc/unit"
158156
)
159157
)
160158
resources.srcDirs(

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# found in the LICENSE file.
55
#
66

7-
ideaVersion=2025.1.3.4
8-
dartPluginVersion= 251.27623.5
7+
ideaVersion=2025.2.1.3
8+
dartPluginVersion= 252.25557.23
99
sinceBuild=243
1010
untilBuild=253.*
1111
javaVersion=21

src/io/flutter/utils/AndroidLocationProvider.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,33 @@
99
import com.android.tools.idea.gradle.project.model.GradleModuleModel;
1010
import com.android.tools.idea.gradle.util.GradleProjectSystemUtil;
1111
import com.android.tools.idea.projectsystem.AndroidProjectRootUtil;
12+
import com.intellij.openapi.diagnostic.Logger;
1213
import com.intellij.openapi.module.Module;
1314
import com.intellij.openapi.project.Project;
1415
import com.intellij.openapi.project.ProjectUtil;
1516
import com.intellij.openapi.vfs.VirtualFile;
17+
import io.flutter.logging.PluginLogger;
1618
import org.jetbrains.annotations.NotNull;
1719
import org.jetbrains.annotations.Nullable;
1820
import org.jetbrains.annotations.SystemIndependent;
1921

2022
// Copied from GradleModelSource.ResolvedConfigurationFileLocationProviderImpl
2123
// This file must be ignored in pre-4.1 builds.
2224
public class AndroidLocationProvider implements BuildModelContext.ResolvedConfigurationFileLocationProvider {
25+
final static private Logger LOG = PluginLogger.createLogger(AndroidLocationProvider.class);
26+
2327
@Nullable
2428
@Override
2529
public VirtualFile getGradleBuildFile(@NotNull Module module) {
26-
GradleModuleModel moduleModel = GradleProjectSystemUtil.getGradleModuleModel(module);
27-
if (moduleModel != null) {
28-
return moduleModel.getBuildFile();
29-
}
30+
// TODO(helin24): Delete this code (and potentially related code) if commenting out has no negative impact on Android editing.
31+
// I believe this is to make gradle files show up nicely when a flutter project is opened, but this functionality already does not work
32+
// and is not needed if we are recommending users edit Android files in a separate project window.
33+
34+
//GradleModuleModel moduleModel = GradleProjectSystemUtil.getGradleModuleModel(module);
35+
//if (moduleModel != null) {
36+
// return moduleModel.getBuildFile();
37+
//}
38+
LOG.info("getGradleBuildFile attempted for module " + module.getName() + " but will return null");
3039
return null;
3140
}
3241

0 commit comments

Comments
 (0)