title: Flutter Gradle Mac Apple-M1 java.io.IOException: Operation not supported
body: <p>I'm getting a Gradle error when building a Flutter APK or debugging on the android simulator on my Mac M1. If anyone could help that would be amazing. Thanks a lot!</p>
  <p>Below is some info:</p>
  <ul>
  <li>I can build APKs of brand <strong>new flutter projects</strong> normally without error.</li>
  <li>I tried removing all external packages and dependencies from the project and still get the error</li>
  <li>The project is debugging fine on iOS simulator</li>
  <li>Versions:</li>
  </ul>
  <pre><code>------------------------------------------------------------
  Gradle 6.7
  ------------------------------------------------------------
  
  Build time:   2020-10-14 16:13:12 UTC
  Revision:     312ba9e0f4f8a02d01854d1ed743b79ed996dfd3
  
  Kotlin:       1.3.72
  Groovy:       2.5.12
  Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
  JVM:          1.8.0_301 (Oracle Corporation 25.301-b09)
  OS:           Mac OS X 10.16 x86_64
  </code></pre>
  <p>Here is my error:</p>
  <pre><code>
   Building with sound null safety 
  
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Gradle could not start your build.
  &gt; Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
     &gt; java.io.IOException: Operation not supported
  
  * 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 1s
  Running Gradle task 'assembleRelease'...                            3.3s
  Gradle task assembleRelease failed with exit code 1
  
  </code></pre>
  <p>and this is the error when I run <code>./gradlew --stacktrace</code></p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Gradle could not start your build.
  &gt; Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
     &gt; java.io.IOException: Operation not supported
  
  * Try:
  Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Exception is:
  org.gradle.initialization.exception.InitializationException: Gradle could not start your build.
          at org.gradle.initialization.exception.DefaultExceptionAnalyser.collectFailures(DefaultExceptionAnalyser.java:65)
          at org.gradle.initialization.exception.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:48)
          at org.gradle.initialization.exception.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
          at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:64)
          at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
          at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
          at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
          at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
          at org.gradle.util.Swapper.swap(Swapper.java:38)
          at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
          at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
          at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
          at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
          at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
          at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
          at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
          at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
  Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:848)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:773)
          at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:563)
          at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:621)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:786)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:772)
          at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:563)
          at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:621)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:786)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:772)
          at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:563)
          at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:621)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.assembleParameters(DefaultServiceRegistry.java:786)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:772)
          at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:563)
          at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:621)
          at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:305)
          at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:289)
          at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:284)
          at org.gradle.initialization.DefaultGradleLauncherFactory.doNewInstance(DefaultGradleLauncherFactory.java:146)
          at org.gradle.initialization.DefaultGradleLauncherFactory.newInstance(DefaultGradleLauncherFactory.java:78)
          at org.gradle.composite.internal.DefaultRootBuildState.&lt;init&gt;(DefaultRootBuildState.java:48)
          at org.gradle.composite.internal.DefaultIncludedBuildRegistry.createRootBuild(DefaultIncludedBuildRegistry.java:86)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:52)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
          at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
          at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:49)
          at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:32)
          at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:27)
          at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
          at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
          at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
          at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
          at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
          at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
          at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
          at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
          at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
          at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
          at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
          at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
          at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
          ... 30 more
  Caused by: org.gradle.api.UncheckedIOException: java.io.IOException: Operation not supported
          at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
          at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
          at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:112)
          at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.incrementLockCount(LockOnDemandCrossProcessCacheAccess.java:106)
          at org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess.acquireFileLock(LockOnDemandCrossProcessCacheAccess.java:168)
          at org.gradle.cache.internal.DefaultCacheAccess.onStartWork(DefaultCacheAccess.java:375)
          at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:211)
          at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:201)
          at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:292)
          at org.gradle.cache.internal.DefaultCacheAccess.newCache(DefaultCacheAccess.java:61)
          at org.gradle.cache.internal.DefaultPersistentDirectoryStore.createCache(DefaultPersistentDirectoryStore.java:162)
          at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.createCache(DefaultCacheFactory.java:186)
          at org.gradle.api.internal.changedetection.state.CrossBuildFileHashCache.createCache(CrossBuildFileHashCache.java:48)
          at org.gradle.api.internal.changedetection.state.CachingFileHasher.&lt;init&gt;(CachingFileHasher.java:45)
          at org.gradle.api.internal.changedetection.state.CachingFileHasher.&lt;init&gt;(CachingFileHasher.java:54)
          at org.gradle.internal.service.scopes.VirtualFileSystemServices$BuildSessionServices.createFileHasher(VirtualFileSystemServices.java:341)
          at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
          at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:34)
          at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:846)
          ... 71 more
  Caused by: java.io.IOException: Operation not supported
          at org.gradle.cache.internal.filelock.LockStateAccess.tryLock(LockStateAccess.java:91)
          at org.gradle.cache.internal.filelock.LockFileAccess.tryLockState(LockFileAccess.java:85)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock$4.run(DefaultFileLockManager.java:363)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock$4.run(DefaultFileLockManager.java:357)
          at org.gradle.internal.io.ExponentialBackoff.retryUntil(ExponentialBackoff.java:59)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockStateRegion(DefaultFileLockManager.java:357)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:301)
          at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.&lt;init&gt;(DefaultFileLockManager.java:163)
          at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:109)
          ... 87 more
  
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 1s
  </code></pre>