title: how to fix finished with non-zero exit value 2
body: <pre><code>import org.apache.tools.ant.taskdefs.condition.Os
  
  apply plugin: 'com.android.library'
  apply plugin: 'com.github.dcendents.android-maven'
  apply plugin: 'com.jfrog.bintray'
  
  Properties properties = new Properties()
  properties.load(project.rootProject.file('local.properties')
  .newDataInputStream())
  
  android {
  compileSdkVersion 23
  buildToolsVersion '26.0.2'
  
  defaultConfig {
      minSdkVersion 9
      targetSdkVersion 22
      versionCode 1
      versionName "1.0"
      consumerProguardFiles 'proguard-rules.pro'
  }
  
  sourceSets {
      main {
          manifest.srcFile 'AndroidManifest.xml'
          java.srcDirs = ['src']
          res.srcDirs = ['res']
          resources.srcDirs = ['src']
          res.srcDirs = ['src/main/res']
          jni.srcDirs = []
         // jniLibs.srcDirs = ['libs']
          jniLibs.srcDir 'src/main/libs'
  
  
      }
  }
  
  
  
  // call regular ndk-build(.cmd) script from app directory
  task ndkBuild(type: Exec) {
      if (Os.isFamily(Os.FAMILY_WINDOWS)) {
          commandLine 'C:/User/frando/AddData/Local/Android/sdk/android-ndk-r16/ndk-build.cmd', '-C', file('src/main').absolutePath
      } else {
          commandLine 'C:/User/frando/AddData/Local/Android/sdk/android-ndk-r16/ndk-build.cmd', '-C', file('src/main').absolutePath
      }
  }
  
  tasks.withType(JavaCompile) {
      compileTask -&gt; compileTask.dependsOn ndkBuild
  }
  
  // Cleanup task to remove previously generated binaries
  task ndkClean(type: Exec) {
      def ndkDirProperty = properties.getProperty('ndk.dir')
      def ndkDirPrefix = ndkDirProperty != null ? ndkDirProperty + '/' : ''
  
      def ndkBuildExt = Os.isFamily(Os.FAMILY_WINDOWS) ? ".cmd" : ""
  
    //  commandLine "${ndkDirPrefix}ndk-build${ndkBuildExt}", '-C', file('.').absolutePath, 'clean'
      commandLine 'C:/User/frando/AddData/Local/Android/sdk/android-ndk-r16/ndk-build.cmd', '-C', file('.').absolutePath, 'clean'
  }
  
  tasks.withType(Delete) {
      cleanTask -&gt; cleanTask.dependsOn ndkClean
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This was asked many times and I tried every solution I see, but nothing works for me. I got this error and been working for 2 days to fix this please help with this</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':libraries:tess-two:ndkBuild'.
    Process 'command 'C:/User/frando/AddData/Local/Android/sdk/android-ndk-r16/ndk-build.cmd'' finished with non-zero exit value 2</p>
  </blockquote>