title: Android Studio ERROR: Executing external native build for ndkBuild when trying to run Gstreamer tutorial
body: <p>I am trying to run the gstreamer android tutorial-5 in Android Sudio 3.5 (<a href="https://gitlab.freedesktop.org/gstreamer/gst-docs/tree/master/examples/tutorials/android)(https://gitlab.com/eduardoprado/gstreamer-tutorial5)" rel="noreferrer">https://gitlab.freedesktop.org/gstreamer/gst-docs/tree/master/examples/tutorials/android)(https://gitlab.com/eduardoprado/gstreamer-tutorial5)</a> but get the following error:</p>
  
  <pre><code>ERROR: Cause: executing external native build for ndkBuild C:\Users\Downloads\gst_docs_master_examples_tutorials_android\examples\tutorials\android\android-tutorial-1\jni\Android.mk. 
  </code></pre>
  
  <p>I have been following both the gstreamer android tutorials on the gstreamer website along with the stackoverflow thread <a href="https://stackoverflow.com/questions/45044210/gstreamer-examples-in-android-studio">Gstreamer examples in Android Studio</a>. </p>
  
  <p>The first goal is to get the gstreamer running on android studio. </p>
  
  <p>There are some threads that error is related to white spaces in the path directory but I have checked and all folders have no white space. Below are some of the files that I have been working with and adapting to make the tutorial run. </p>
  
  <p>I have also set my windows environment variable GSTREAMER_ROOT_ANDROID to the unpacked gstreamer binaries along with set it in the android.mk file. </p>
  
  <p>local.properties file </p>
  
  <pre><code>## This file must *NOT* be checked into Version Control Systems,
  # as it contains information specific to your local configuration.
  #
  # Location of the SDK. This is only used by Gradle.
  # For customization when using a Version Control System, please read the
  # header note.
  #Mon Sep 09 08:16:12 EDT 2019
  sdk.dir=C\:\\Users\\AppData\\Local\\Android\\Sdk
  ndk.dir=C\:\\Users\\AppData\\Local\\Android\\Sdk\\ndk\\20.0.5594570
  
  </code></pre>
  
  <p>Android.mk</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE    := tutorial-5
  LOCAL_SRC_FILES := tutorial-5.c
  LOCAL_SHARED_LIBRARIES := gstreamer_android
  LOCAL_LDLIBS := -llog -landroid
  include $(BUILD_SHARED_LIBRARY)
  
  GSTREAMER_ROOT_ANDROID := C\:\\gstreamer_android_binaries
  
  ifndef GSTREAMER_ROOT_ANDROID
  $(error GSTREAMER_ROOT_ANDROID is not defined!)
  endif
  
  ifeq ($(TARGET_ARCH_ABI),armeabi)
  GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/arm
  else ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
  GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/armv7
  else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
  GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/arm64
  else ifeq ($(TARGET_ARCH_ABI),x86)
  GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/x86
  else ifeq ($(TARGET_ARCH_ABI),x86_64)
  GSTREAMER_ROOT        := $(GSTREAMER_ROOT_ANDROID)/x86_64
  else
  $(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
  endif
  
  GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
  include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
  GSTREAMER_PLUGINS         := $(GSTREAMER_PLUGINS_CORE) $(GSTREAMER_PLUGINS_PLAYBACK) $(GSTREAMER_PLUGINS_CODECS) $(GSTREAMER_PLUGINS_NET) $(GSTREAMER_PLUGINS_SYS)
  G_IO_MODULES              := gnutls
  GSTREAMER_EXTRA_DEPS      := gstreamer-video-1.0
  include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
  
  </code></pre>
  
  <p>build.gradle (app)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 29
      buildToolsVersion "26.0.3"
  
      defaultConfig {
          applicationId "com.gst_sdk_tutorials.tutorial_5"
          minSdkVersion 14
          targetSdkVersion 29
  
          externalNativeBuild {
              ndkBuild {
                  arguments "V=1"
              }
          }
  
          ndk {
              moduleName "tutorial-5"
              abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
          }
      }
  
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
      externalNativeBuild {
          ndkBuild {
              path 'src/main/jni/Android.mk'
          }
      }
  }
  </code></pre>
  
  <p>build.gradle (project)</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
      repositories {
          jcenter()
          google()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.5.0'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p>gradle-wrapper.properties</p>
  
  <pre><code>#Mon Sep 09 14:10:17 EDT 2019
  distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
  </code></pre>
  
  <p><strong>UPDATE</strong>
  Added the argument "V=1" to the ndkBuild section and received the same error:</p>
  
  <pre><code>ERROR: Cause: executing external native build for ndkBuild C:\Users\Downloads\gstreamer-tutorial5-master\app\src\main\jni\Android.mk
  </code></pre>