Skip to content

Build fails with "Unresolved reference: filePermissions" in FlutterPlugin.kt #178492

@surjyam

Description

@surjyam

Steps to reproduce

Description
My Flutter project consistently fails to build with a Kotlin compilation error in the Flutter SDK's own FlutterPlugin.kt file. The error is Unresolved reference: filePermissions.This error occurs on a fresh project created with flutter create as well as my existing project. It has survived a complete reinstall of the Flutter SDK, clearing all Gradle and Flutter caches, and multiple attempts to reconfigure the project's Gradle files.

Expected results

a successful Flutter run and application build

Actual results

Resolving dependencies...
Downloading packages...
  characters 1.4.0 (1.4.1 available)
  flutter_hooks 0.20.5 (0.21.3+1 available)
  http 1.5.0 (1.6.0 available)
  material_color_utilities 0.11.1 (0.13.0 available)
  test_api 0.7.7 (0.7.8 available)
Got dependencies!
5 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/Users/surjyamisraadmin/.gradle/wrapper/dists/gradle-7.5-all/6qsw290k5lz422uaf8jf6m7co/gradle-7.5/lib/native-platform-0.22-milestone-23.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

e: file:///Users/surjyamisraadmin/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:744:21 Unresolved reference: filePermissions
e: file:///Users/surjyamisraadmin/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:745:25 Unresolved reference: user
e: file:///Users/surjyamisraadmin/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:746:29 Unresolved reference: read
e: file:///Users/surjyamisraadmin/flutter/packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt:747:29 Unresolved reference: write

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gradle:compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Error: Gradle task assembleDebug failed with exit code 1

Code sample

surjyamisraadmin@MacBook-Pro-3 Spin_to_Win % flutter doctor -v

[✓] Flutter (Channel beta, 3.39.0-0.1.pre, on macOS 15.7.2 24G325 darwin-x64, locale en-US) [1,424ms]
    • Flutter version 3.39.0-0.1.pre on channel beta at /Users/surjyamisraadmin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cbb46938ee (3 days ago), 2025-11-10 17:13:11 -0600
    • Engine revision b9afb03275
    • Dart version 3.11.0 (build 3.11.0-93.1.beta)
    • DevTools version 2.52.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
      omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [4.4s]
    • Android SDK at /Users/surjyamisraadmin/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version Java(TM) SE Runtime Environment (build 25.0.1+8-LTS-27)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 26.1.1) [2.4s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17B100
    ✗ Unable to get list of installed Simulator runtimes.
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [18ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [7.6s]
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 16 (API 36) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 15.7.2 24G325 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 142.0.7444.135

[✓] Network resources [372ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.
surjyamisraadmin@MacBook-Pro-3 Spin_to_Win % 

I am running this for an android device

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: solvedIssue is closed as solved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions