title: Android NDK : make: *** No rule to make target. Stop
body: <p>I am trying to build <a href="https://github.com/libusb/libusb/tree/master/libusb" rel="nofollow noreferrer">libusb</a> using the NDK. Here is my <code>Android.mk</code> and <code>Application.mk</code> I have checked this thread <a href="https://stackoverflow.com/questions/6243047/android-ndk-no-rule-to-make-target">Android NDK: No rule to make target</a> but it didn't work for me.</p>
  
  <p>Android.mk</p>
  
  <pre><code>include $(CLEAR_VARS)
  LOCAL_MODULE    := libusb
  LOCAL_SRC_FILES := libusb/core.c libusb/descriptor.c libusb/io.c libusb/sync.c libusb/os/linux_usbfs.c
  
  LOCAL_LDLIBS    := -llog
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Application.mk</p>
  
  <pre><code>APP_ABI:= all
  APP_LDFLAGS:= -llog
  APP_STL:= stlport_shared
  APP_CPP_FEATURES:= exceptions
  APP_PLATFORM:= android-21
  APP_CFLAGS:= -g
  </code></pre>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  android {
      compileSdkVersion 26
      buildToolsVersion "26.0.0"
      defaultConfig {
          applicationId "com.williams.libusbpoc"
          minSdkVersion 21
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      androidTestImplementation ('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
      implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
      testImplementation 'junit:junit:4.12'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  }
  </code></pre>
  
  <p>local.properties</p>
  
  <pre><code>ndk.dir=C\:\\android-ndk-r15
  </code></pre>
  
  <p>Project structure looks like below: </p>
  
  <p><a href="https://i.stack.imgur.com/hciDY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hciDY.png" alt="enter image description here"></a></p>
  
  <p>When I am running <code>ndk-build</code> then I get </p>
  
  <pre><code>ndk-build
  Android NDK: WARNING: APP_PLATFORM android-21 is higher than android:minSdkVersion 1 in D:/williams/android/libusbpoc/app/src/main/AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-21. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
  make: *** No rule to make target `C:/android-ndk-r15/build//../sources/cxx-stl/stlport/libusb/core.c', needed by `D:/williams/android/libusbpoc/app/src/main/obj/local/arm64-v8a/objs/usb/libusb/core.o'.  Stop.
  </code></pre>
  
  <p>Does anyone know what I am doing wrong ?</p>