title: caffe2 build android Failed to configure test project build system
body: <p>I want to build caffe2 on macOS.</p>
  
  <p>build caffe2 is every thing OK, but when I build android, use <code>caffe2/scripts/build_android.sh</code> the processing is to 100% and then occurred:</p>
  
  <pre><code>CMake Error at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CheckCXXSourceCompiles.cmake:97 (try_compile):
  Failed to configure test project build system.
  Call Stack (most recent call first):
    cmake/MiscCheck.cmake:34 (CHECK_CXX_SOURCE_COMPILES)
    CMakeLists.txt:61 (include)
  </code></pre>
  
  <p>my cmake version is :</p>
  
  <pre><code>cmake version 3.10.1
  
  CMake suite maintained and supported by Kitware (kitware.com/cmake).
  </code></pre>
  
  <p>the all log is :</p>
  
  <pre><code>```
  
  CMake Error at third_party/android-cmake/android.toolchain.cmake:310 (file):
  file STRINGS file
  "/Users/zhouhuacong/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/android/api-level.h"
  cannot be read.
  Call Stack (most recent call first):
  third_party/android-cmake/android.toolchain.cmake:814 (__DETECT_NATIVE_API_LEVEL)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:6 (project)
  
  
  CMake Error at third_party/android-cmake/android.toolchain.cmake:816 (message):
  Specified Android API level (21) does not match to the level found ().
  Probably your copy of NDK is broken.
  Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:6 (project)
  
  
  CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:69 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
  Call Stack (most recent call first):
  third_party/android-cmake/android.toolchain.cmake:1139 (CMAKE_FORCE_C_COMPILER)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:6 (project)
  
  
  CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:83 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
  Call Stack (most recent call first):
  third_party/android-cmake/android.toolchain.cmake:1151 (CMAKE_FORCE_CXX_COMPILER)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (include)
  CMakeLists.txt:6 (project)
  
  
  -- Performing Test CAFFE2_LONG_IS_INT32_OR_64
  CMake Error at /Users/zhouhuacong/CaffeProject/caffe2/third_party/android-cmake/android.toolchain.cmake:310 (file):
  file STRINGS file
  "/Users/zhouhuacong/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/android/api-level.h"
  cannot be read.
  Call Stack (most recent call first):
  /Users/zhouhuacong/CaffeProject/caffe2/third_party/android-cmake/android.toolchain.cmake:814 (__DETECT_NATIVE_API_LEVEL)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/3.10.1/CMakeSystem.cmake:6 (include)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
  
  
  CMake Error at /Users/zhouhuacong/CaffeProject/caffe2/third_party/android-cmake/android.toolchain.cmake:816 (message):
  Specified Android API level (21) does not match to the level found ().
  Probably your copy of NDK is broken.
  Call Stack (most recent call first):
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/3.10.1/CMakeSystem.cmake:6 (include)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
  
  
  CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:69 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
  Call Stack (most recent call first):
  /Users/zhouhuacong/CaffeProject/caffe2/third_party/android-cmake/android.toolchain.cmake:1139 (CMAKE_FORCE_C_COMPILER)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/3.10.1/CMakeSystem.cmake:6 (include)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
  
  
  CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:83 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
  Call Stack (most recent call first):
  /Users/zhouhuacong/CaffeProject/caffe2/third_party/android-cmake/android.toolchain.cmake:1151 (CMAKE_FORCE_CXX_COMPILER)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/3.10.1/CMakeSystem.cmake:6 (include)
  /Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
  
  
  CMake Error at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CheckCXXSourceCompiles.cmake:97 (try_compile):
  Failed to configure test project build system.
  Call Stack (most recent call first):
  cmake/MiscCheck.cmake:34 (CHECK_CXX_SOURCE_COMPILES)
  CMakeLists.txt:61 (include)
  
  
  -- Configuring incomplete, errors occurred!
  See also "/Users/zhouhuacong/CaffeProject/caffe2/build_android/CMakeFiles/CMakeOutput.log".
  ```
  </code></pre>
  
  <p>I find the first error <code>file STRINGS file
      "/Users/zhouhuacong/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/include/android/api-level.h"
      cannot be read.</code>
  but i don't find the <code>include</code> folder in my mac. there are only <code>/Users/zhouhuacong/Library/Android/sdk/ndk-bundle/platforms/android-21/arch-arm/usr/lib</code> folder. </p>
  
  <p>Is this my NDK environment problem? I use the <code>Android Studio 3.0</code>, and download <code>NDK 16</code>.</p>
  
  <p>Where am I wrong?</p>