I’m currently facing a strange error when trying to build my Flutter app on macOS.
I’m using Flutter 2.10.5 (via FVM) because my project SDK constraint is:
environment:
sdk: ">=2.12.0 <3.0.0"
Whenever I try to run the app (fvm flutter run), I get this error:
Launching lib/main.dart on Redmi Note 5 in debug mode...
e: file:///Users/babanla/development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:764:21 Unresolved reference: filePermissions
e: file:///Users/babanla/development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:765:25 Unresolved reference: user
e: file:///Users/babanla/development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:766:29 Unresolved reference: read
e: file:///Users/babanla/development/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:767:29 Unresolved reference: write
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gradle:compileKotlin'.
> Compilation error. See log for more details
✅ What I’ve tried
Deleted Gradle caches and build folders:
rm -rf android/.gradle rm -rf android/build fvm flutter clean fvm flutter pub getVerified Flutter version:
Flutter 2.10.5 • Dart 2.16.2Updated Gradle versions in
android/build.gradleandgradle-wrapper.properties:// build.gradle classpath 'com.android.tools.build:gradle:4.1.0'# gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zipReinstalled Flutter SDK with FVM (
fvm remove 2.10.5→fvm install 2.10.5).
Still, the error persists and appears to originate from Flutter’s internal Gradle Kotlin files.
💻 My environment
macOS (Sonoma 14.x)
Flutter 2.10.5 (via FVM)
Gradle 6.7
Android Gradle Plugin 4.1.0
Kotlin plugin (bundled with Flutter)
❓ My question
What could be causing these "Unresolved reference" errors in Flutter’s internal FlutterPlugin.kt file, and how can I properly reset or align my SDK and Gradle setup so that the project builds successfully again?
-
Can you share your pubspec.yaml file?tomerpacific– tomerpacific2025年11月08日 06:30:23 +00:00Commented Nov 8 at 6:30
-
Im facing the same issue with 3.38.1Samuel Pérez– Samuel Pérez2025年11月16日 15:50:00 +00:00Commented 2 days ago