flutter / flutter/flutter-intellij

dev.flutter.flutter-gradle-plugin conflicts with repositoriesMode = PREFER_PROJECT when running Gemini Journeys in Android Studio Preview

Open
#8,230 1 comment 0 reactions 0 assignees View on GitHub
P2
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

### Use case

### **Description**:

When I run a **Gemini Journey** in **Android Studio Preview (2025.1.2)** on a Flutter project, the build fails with this error:

```
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle.kts'
```

I **did not make any manual changes** to the `build.gradle.kts` file related to repositories. This issue **only happens when running a Journey**. If I just build or run the app normally in Android Studio Preview, it works without any issues.

### Proposal

---

### **Steps to Reproduce**:

1. Create a standard Flutter project.
2. Open it in **Android Studio Preview (2025.1.2)**.
3. Run a **Gemini Journey**.
4. Build fails with the error above.

---

### **Expected Behavior**:

The project should build successfully when running a Journey, just like it does when running normally.

Sample app -> https://github.com/armanso/Flutter-Journeys

---

### **Actual Behavior**:

The build fails with a repository conflict error caused by a `repositoriesMode` violation.

---

### **Flutter Doctor Output**:

```
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
[✓] Android Studio (version 2025.1.2)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.