title: React Native: A problem occurred evaluating project ':app' when trying to run on Android
body: <p>I have a react native app and when I try to run it on my android device i get the following error:</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * Where:
  Build file '/Users/myname/Desktop/myapp/android/app/build.gradle' line: 1
  
  * What went wrong:
  A problem occurred evaluating project ':app'.
  &gt; Failed to apply plugin [id 'com.android.application']
     &gt; java.nio.file.AccessDeniedException: /Users/myname/.android/build-cache.lock
  </code></pre>
  
  <p>I'm using the following versions:<br></p>
  
  <ul>
  <li>react native: 0.57.3</li>
  <li>Android studio: 3.2.1</li>
  <li>java: "1.8.0_191"</li>
  <li>distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip</li>
  <li>macOS: Mojave 10.14.1</li>
  </ul>
  
  <p>I tried to change Gradle versions but it didn't work. This is my <code>app/build.gradle</code>:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      ext {
          buildToolsVersion = "27.0.3"
          minSdkVersion = 16
          compileSdkVersion = 27
          targetSdkVersion = 26
          supportLibVersion = "27.1.1"
      }
      repositories {
          jcenter()
          google()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.1.4'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  allprojects {
      repositories {
          mavenLocal()
          jcenter()
          maven {
              // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
              url "$rootDir/../node_modules/react-native/android"
          }
          google()
      }
  }
  task wrapper(type: Wrapper) {
      gradleVersion = '4.4'
      distributionUrl = distributionUrl.replace("bin", "all")
  }</code></pre>
  </div>
  </div>
  </p>