title: gradle experimental plugin ndk, stl related problems
body: <p>I am trying to enable ndk support in android studio, and facing issues related to <code>mutex</code> and other headers. I have taken a look at this <a href="https://stackoverflow.com/questions/4893403/cant-include-c-headers-like-vector-in-android-ndk?rq=1">Can&#39;t include C++ headers like vector in Android NDK</a>, but my understanding is that with the experimental plugin, all the settings that were in Android.mk need to be done within <code>app/build.gradle</code></p>
  
  <pre><code>Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources, :cpp_example_util:generateDebugSources, :cpp_example_util:generateDebugAndroidTestSources, :cpp_example_util:mockableAndroidJar, :cpp_example_util:prepareDebugUnitTestDependencies, :cpp_example_util:compileDebugSources, :cpp_example_util:compileDebugAndroidTestSources, :cpp_example_util:compileDebugUnitTestSources]
  /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/point_cloud_renderer.cc
  Information:(17) (Unknown) In file included
  /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/tango-plane-fitting/point_cloud_renderer.h
  Error:(20, 17) mutex: No such file or directory
  /home/mihai/Projects/tango-ar/tango_client_api/include/tango_client_api.h
  Information:(19) (Unknown) In file included
  /home/mihai/Projects/tango-ar/third_party/glm/glm/mat2x2.hpp
  Information:(31) (Unknown) In file included
  /home/mihai/Projects/tango-ar/third_party/glm/glm/detail/type_mat2x2.hpp
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/gabi++/include/cstdint
  Information:(37) (Unknown) In file included
  /usr/include/stdint.h
  Warning:(148) warning: "__INT64_C" redefined
  Warning:(149) warning: "__UINT64_C" redefined
  Warning:(148) warning: "__INT64_C" redefined
  Warning:(149) warning: "__UINT64_C" redefined
  Warning:(148) warning: "__INT64_C" redefined
  Warning:(149) warning: "__UINT64_C" redefined
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_algobase.h
  Information:(720) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_algobase.c
  Error:(301, 26) error: 'UCHAR_MAX' was not declared in this scope
  Error:(301, 43) error: 'CHAR_BIT' was not declared in this scope
  Error:(302, 10) error: '__hints' was not declared in this scope
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_cprolog.h
  Information:(18) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_limits.h
  Error:(124, 81) error: 'CHAR_BIT' was not declared in this scope
  Error:(198, 45) error: 'CHAR_MIN' was not declared in this scope
  Error:(198, 55) error: 'CHAR_MAX' was not declared in this scope
  Error:(198, 73) error: template argument 2 is invalid
  Error:(198, 73) error: template argument 3 is invalid
  Error:(204, 52) error: 'SCHAR_MIN' was not declared in this scope
  Error:(204, 63) error: 'SCHAR_MAX' was not declared in this scope
  Error:(204, 82) error: template argument 2 is invalid
  Error:(204, 82) error: template argument 3 is invalid
  Error:(210, 57) error: 'UCHAR_MAX' was not declared in this scope
  Error:(210, 76) error: template argument 3 is invalid
  Error:(224, 46) error: 'SHRT_MIN' was not declared in this scope
  Error:(224, 56) error: 'SHRT_MAX' was not declared in this scope
  Error:(224, 74) error: template argument 2 is invalid
  Error:(224, 74) error: template argument 3 is invalid
  Error:(229, 58) error: 'USHRT_MAX' was not declared in this scope
  Error:(229, 77) error: template argument 3 is invalid
  Error:(239, 44) error: 'INT_MIN' was not declared in this scope
  Error:(239, 53) error: 'INT_MAX' was not declared in this scope
  Error:(239, 70) error: template argument 2 is invalid
  Error:(239, 70) error: template argument 3 is invalid
  Error:(244, 56) error: 'UINT_MAX' was not declared in this scope
  Error:(244, 74) error: template argument 3 is invalid
  Error:(249, 45) error: 'LONG_MIN' was not declared in this scope
  Error:(249, 55) error: 'LONG_MAX' was not declared in this scope
  Error:(249, 73) error: template argument 2 is invalid
  Error:(249, 73) error: template argument 3 is invalid
  Error:(254, 57) error: 'ULONG_MAX' was not declared in this scope
  Error:(254, 76) error: template argument 3 is invalid
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/config/features.h
  Information:(803, 75) in definition of macro '_STLP_STATIC_CONSTANT'
  Information:(311, 66) in definition of macro '_STLP_STATIC_ASSERT'
  Information:(583, 51) in definition of macro '__STATIC_CAST'
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_num_put.c
  Information:(26) (Unknown) In file included
  Error:(158, 71) error: 'is_signed' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(159, 82) error: 'max' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Information:(159, 55) in expansion of macro '__STATIC_CAST'
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_istream.h
  Information:(352) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_istream.c
  Error:(651, 73) error: 'is_signed' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(652, 88) error: 'max' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Information:(652, 61) in expansion of macro '__STATIC_CAST'
  Error:(865, 11) error: 'max' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(1110, 33) error: 'max' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(1112, 17) error: 'max' is not a member of 'std::numeric_limits&lt;int&gt;'
  Error:(1150, 33) error: 'max' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(1152, 17) error: 'max' is not a member of 'std::numeric_limits&lt;int&gt;'
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_algo.c
  Information:(34) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_tempbuf.h
  Error:(89, 30) error: 'INT_MAX' was not declared in this scope
  Information:(160) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_tempbuf.c
  Error:(39, 25) error: 'INT_MAX' was not declared in this scope
  /usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h
  Error:(479, 45) error: 'CHAR_BIT' was not declared in this scope
  Error:(522, 61) error: template argument 3 is invalid
  Error:(522, 61) error: template argument 4 is invalid
  Error:(523, 43) error: 'CHAR_BIT' was not declared in this scope
  /usr/local/include/eigen3/Eigen/src/Core/DenseStorage.h
  Error:(277, 16) error: 'move' is not a member of 'std'
  Error:(278, 16) error: 'move' is not a member of 'std'
  Error:(279, 16) error: 'move' is not a member of 'std'
  Error:(336, 16) error: 'move' is not a member of 'std'
  Error:(337, 16) error: 'move' is not a member of 'std'
  Error:(390, 16) error: 'move' is not a member of 'std'
  Error:(391, 16) error: 'move' is not a member of 'std'
  /usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h
  Error:(442, 20) error: 'move' is not a member of 'std'
  /usr/local/include/eigen3/Eigen/src/Core/Matrix.h
  Error:(216, 14) error: 'move' is not a member of 'std'
  /usr/local/include/eigen3/Eigen/Core
  Information:(259) (Unknown) In file included
  Information:(258) (Unknown) In file included
  Information:(288) (Unknown) In file included
  Information:(293) (Unknown) In file included
  Information:(294) (Unknown) In file included
  Information:(295) (Unknown) In file included
  /usr/local/include/eigen3/Eigen/src/Core/Array.h
  Error:(129, 14) error: 'move' is not a member of 'std'
  /usr/local/include/boost/smart_ptr/detail/sp_nullptr_t.hpp
  Error:(35, 18) error: 'nullptr_t' in namespace 'std' does not name a type
  /usr/local/include/boost/shared_ptr.hpp
  Information:(17) (Unknown) In file included
  /usr/local/include/boost/config.hpp
  Information:(61) (Unknown) In file included
  /usr/local/include/boost/smart_ptr/shared_ptr.hpp
  Information:(31) (Unknown) In file included
  Error:(340, 45) error: invalid use of '::'
  Error:(340, 45) error: expected ';' at end of member declaration
  Error:(340, 47) error: expected unqualified-id before 'noexcept'
  Error:(365, 63) error: expected ')' before 'p'
  Error:(380, 72) error: expected ')' before 'p'
  Error:(604, 57) error: declaration of 'operator=' as non-function
  Error:(604, 26) error: expected ';' at end of member declaration
  Error:(604, 57) error: ISO C++ forbids declaration of 'sp_nullptr_t' with no type [-fpermissive]
  Error:(604, 57) error: invalid use of '::'
  Error:(604, 57) error: expected ';' at end of member declaration
  Error:(604, 59) error: expected unqualified-id before 'noexcept'
  Error:(751, 83) error: 'boost::detail::sp_nullptr_t' has not been declared
  Error:(756, 58) error: declaration of 'operator==' as non-function
  Error:(756, 43) error: 'sp_nullptr_t' is not a member of 'boost::detail'
  Error:(756, 86) error: expected primary-expression before 'const'
  Error:(761, 83) error: 'boost::detail::sp_nullptr_t' has not been declared
  Error:(766, 58) error: declaration of 'operator!=' as non-function
  Error:(766, 43) error: 'sp_nullptr_t' is not a member of 'boost::detail'
  Error:(766, 86) error: expected primary-expression before 'const'
  /usr/local/include/boost/signals2.hpp
  Information:(15) (Unknown) In file included
  /usr/local/include/boost/signals2/deconstruct.hpp
  Error:(72, 17) error: 'forward' is not a member of 'std'
  Error:(72, 34) error: expected primary-expression before '&gt;' token
  Error:(299, 22) error: 'forward' is not a member of 'std'
  Error:(299, 39) error: expected primary-expression before '&gt;' token
  Error:(480, 48) error: 'forward' is not a member of 'std'
  Error:(480, 65) error: expected primary-expression before '&gt;' token
  /usr/local/include/boost/utility/addressof.hpp
  Information:(15) (Unknown) In file included
  /usr/local/include/boost/core/addressof.hpp
  Error:(58, 18) error: 'nullptr_t' in namespace 'std' does not name a type
  Error:(62, 35) error: 'addr_nullptr_t' was not declared in this scope
  Error:(62, 50) error: template argument 1 is invalid
  Error:(72, 35) error: 'addr_nullptr_t' was not declared in this scope
  Error:(72, 56) error: template argument 1 is invalid
  Error:(82, 35) error: 'addr_nullptr_t' was not declared in this scope
  Error:(82, 59) error: template argument 1 is invalid
  Error:(92, 35) error: 'addr_nullptr_t' was not declared in this scope
  Error:(92, 65) error: template argument 1 is invalid
  /usr/local/include/boost/integer_fwd.hpp
  Error:(137, 29) error: 'digits' is not a member of 'std::numeric_limits&lt;unsigned char&gt;'
  Error:(137, 29) error: 'digits' is not a member of 'std::numeric_limits&lt;unsigned char&gt;'
  Error:(137, 74) error: template argument 1 is invalid
  /usr/local/include/boost/integer_traits.hpp
  Error:(83, 46) error: 'CHAR_MIN' was not declared in this scope
  Error:(83, 56) error: 'CHAR_MAX' was not declared in this scope
  Error:(83, 64) error: template argument 2 is invalid
  Error:(83, 64) error: template argument 3 is invalid
  Error:(89, 53) error: 'SCHAR_MIN' was not declared in this scope
  Error:(89, 64) error: 'SCHAR_MAX' was not declared in this scope
  Error:(89, 73) error: template argument 2 is invalid
  Error:(89, 73) error: template argument 3 is invalid
  Error:(95, 58) error: 'UCHAR_MAX' was not declared in this scope
  Error:(95, 67) error: template argument 3 is invalid
  Error:(131, 47) error: 'SHRT_MIN' was not declared in this scope
  Error:(131, 57) error: 'SHRT_MAX' was not declared in this scope
  Error:(131, 65) error: template argument 2 is invalid
  Error:(131, 65) error: template argument 3 is invalid
  Error:(137, 59) error: 'USHRT_MAX' was not declared in this scope
  Error:(137, 68) error: template argument 3 is invalid
  Error:(143, 45) error: 'INT_MIN' was not declared in this scope
  Error:(143, 54) error: 'INT_MAX' was not declared in this scope
  Error:(143, 61) error: template argument 2 is invalid
  Error:(143, 61) error: template argument 3 is invalid
  Error:(149, 57) error: 'UINT_MAX' was not declared in this scope
  Error:(149, 65) error: template argument 3 is invalid
  Error:(155, 46) error: 'LONG_MIN' was not declared in this scope
  Error:(155, 56) error: 'LONG_MAX' was not declared in this scope
  Error:(155, 64) error: template argument 2 is invalid
  Error:(155, 64) error: template argument 3 is invalid
  Error:(161, 58) error: 'ULONG_MAX' was not declared in this scope
  Error:(161, 67) error: template argument 3 is invalid
  /usr/local/include/boost/function/function_base.hpp
  Information:(21) (Unknown) In file included
  /usr/local/include/boost/type_traits/type_with_alignment.hpp
  Information:(19) (Unknown) In file included
  /usr/local/include/boost/integer.hpp
  Information:(18) (Unknown) In file included
  Information:(20) (Unknown) In file included
  Error:(84, 68) error: 'CHAR_BIT' was not declared in this scope
  Error:(84, 76) error: template argument 1 is invalid
  Error:(85, 72) error: 'CHAR_BIT' was not declared in this scope
  Error:(85, 80) error: template argument 1 is invalid
  Error:(104, 78) error: 'CHAR_BIT' was not declared in this scope
  Error:(104, 86) error: template argument 1 is invalid
  Error:(105, 81) error: 'CHAR_BIT' was not declared in this scope
  Error:(105, 89) error: template argument 1 is invalid
  Error:(117, 7) error: 'CHAR_BIT' was not declared in this scope
  Error:(122, 58) error: 'CHAR_BIT' was not declared in this scope
  Error:(126, 22) error: 'digits' is not a member of 'std::numeric_limits&lt;long int&gt;'
  Error:(127, 22) error: 'digits' is not a member of 'std::numeric_limits&lt;int&gt;'
  Error:(128, 22) error: 'digits' is not a member of 'std::numeric_limits&lt;short int&gt;'
  Error:(129, 22) error: 'digits' is not a member of 'std::numeric_limits&lt;signed char&gt;'
  Error:(130, 9) error: template argument 1 is invalid
  Error:(138, 6) error: 'CHAR_BIT' was not declared in this scope
  Error:(153, 58) error: 'CHAR_BIT' was not declared in this scope
  Error:(157, 20) error: 'digits' is not a member of 'std::numeric_limits&lt;long unsigned int&gt;'
  Error:(158, 20) error: 'digits' is not a member of 'std::numeric_limits&lt;unsigned int&gt;'
  Error:(159, 20) error: 'digits' is not a member of 'std::numeric_limits&lt;short unsigned int&gt;'
  Error:(160, 20) error: 'digits' is not a member of 'std::numeric_limits&lt;unsigned char&gt;'
  Error:(161, 9) error: template argument 1 is invalid
  Error:(184, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;long int&gt;'
  Error:(185, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;int&gt;'
  Error:(186, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;short int&gt;'
  Error:(187, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;signed char&gt;'
  Error:(188, 9) error: template argument 1 is invalid
  Error:(206, 24) error: 'const_min' is not a member of 'boost::integer_traits&lt;long int&gt;'
  Error:(207, 24) error: 'const_min' is not a member of 'boost::integer_traits&lt;int&gt;'
  Error:(208, 24) error: 'const_min' is not a member of 'boost::integer_traits&lt;short int&gt;'
  Error:(209, 24) error: 'const_min' is not a member of 'boost::integer_traits&lt;signed char&gt;'
  Error:(210, 9) error: template argument 1 is invalid
  Error:(250, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;long unsigned int&gt;'
  Error:(251, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;unsigned int&gt;'
  Error:(252, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;short unsigned int&gt;'
  Error:(253, 24) error: 'const_max' is not a member of 'boost::integer_traits&lt;unsigned char&gt;'
  Error:(254, 9) error: template argument 1 is invalid
  /usr/local/include/boost/scoped_ptr.hpp
  Information:(14) (Unknown) In file included
  /usr/local/include/boost/smart_ptr/scoped_ptr.hpp
  Error:(121, 83) error: 'boost::detail::sp_nullptr_t' has not been declared
  Error:(126, 58) error: declaration of 'operator==' as non-function
  Error:(126, 43) error: 'sp_nullptr_t' is not a member of 'boost::detail'
  Error:(126, 86) error: expected primary-expression before 'const'
  Error:(131, 83) error: 'boost::detail::sp_nullptr_t' has not been declared
  Error:(136, 58) error: declaration of 'operator!=' as non-function
  Error:(136, 43) error: 'sp_nullptr_t' is not a member of 'boost::detail'
  Error:(136, 86) error: expected primary-expression before 'const'
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_vector.h
  Information:(729) (Unknown) In file included
  /home/mihai/Android/Sdk/ndk-bundle/sources/cxx-stl/stlport/stlport/stl/_bvector.h
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(110, 24) in expansion of macro '_STLP_WORD_BIT'
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(118, 19) in expansion of macro '_STLP_WORD_BIT'
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(133, 19) in expansion of macro '_STLP_WORD_BIT'
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(143, 12) in expansion of macro '_STLP_WORD_BIT'
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(298, 24) in expansion of macro '_STLP_WORD_BIT'
  Error:(37, 29) error: 'CHAR_BIT' was not declared in this scope
  Information:(404, 47) in expansion of macro '_STLP_WORD_BIT'
  /usr/local/include/boost/signals2/signal.hpp
  Information:(22) (Unknown) In file included
  /usr/local/include/boost/move/utility.hpp
  Information:(28) (Unknown) In file included
  /usr/local/include/boost/signals2/connection.hpp
  Error:(164, 62) error: 'move' is not a member of 'std'
  Information:(164, 62) suggested alternatives:
  In file included from /usr/local/include/boost/move/move.hpp:32:0,
                   from /usr/local/include/boost/variant/detail/move.hpp:28,
                   from /usr/local/include/boost/variant/detail/initializer.hpp:23,
                   from /usr/local/include/boost/variant/variant.hpp:30,
                   from /usr/local/include/boost/signals2/slot_base.hpp:22,
                   from /usr/local/include/boost/signals2/detail/tracked_objects_visitor.hpp:18,
                   from /usr/local/include/boost/signals2/slot.hpp:22,
                   from /usr/local/include/boost/signals2/connection.hpp:23,
                   from /usr/local/include/boost/signals2/signal.hpp:22,
                   from /usr/local/include/boost/signals2.hpp:19,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/tango-plane-fitting/localisation_interface.hpp:7,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/tango-plane-fitting/Floor.h:9,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/Floor.cpp:5:
  /usr/local/include/boost/move/algorithm.hpp:55:6: note:   'boost::move'
  Error:(173, 33) error: 'move' is not a member of 'std'
  Information:(173, 33) suggested alternatives:
  In file included from /usr/local/include/boost/move/move.hpp:32:0,
                   from /usr/local/include/boost/variant/detail/move.hpp:28,
                   from /usr/local/include/boost/variant/detail/initializer.hpp:23,
                   from /usr/local/include/boost/variant/variant.hpp:30,
                   from /usr/local/include/boost/signals2/slot_base.hpp:22,
                   from /usr/local/include/boost/signals2/detail/tracked_objects_visitor.hpp:18,
                   from /usr/local/include/boost/signals2/slot.hpp:22,
                   from /usr/local/include/boost/signals2/connection.hpp:23,
                   from /usr/local/include/boost/signals2/signal.hpp:22,
                   from /usr/local/include/boost/signals2.hpp:19,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/tango-plane-fitting/localisation_interface.hpp:7,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/tango-plane-fitting/Floor.h:9,
                   from /home/mihai/Projects/tango-ar/cpp_plane_fitting_example/app/src/main/jni/Floor.cpp:5:
  /usr/local/include/boost/move/algorithm.hpp:55:6: note:   'boost::move'...
  </code></pre>
  
  <p>This is my <code>app/build.gradle</code>:</p>
  
  <pre><code>apply plugin: 'com.android.model.application'
  model {
      android {
          compileSdkVersion 23
          buildToolsVersion "24"
  
          defaultConfig {
              applicationId "com.projecttango.examples.cpp.planefitting"
              minSdkVersion.apiLevel 19
              targetSdkVersion.apiLevel 19
              versionCode 1
              versionName "1.0"
  
              buildTypes {
                  release {
                      minifyEnabled false
                      proguardFiles.add(file("proguard-android.txt"))
  
                      ndk {
                          debuggable = true
                      }
                  }
                  debug {
                      debuggable = true
                  }
              }
          }
  
          ndk {
              moduleName "tango-plane-fitting"
              stl "stlport_static"
              cppFlags.add("-I${file("src/main/jni/tango-plane-fitting/")}".toString())
              cppFlags.add("-I${file("/usr/local/include/")}".toString())
              cppFlags.add("-I${file("/usr/include/")}".toString())
              cppFlags.add("-I${file("/usr/include/x86_64-linux-gnu/")}".toString())
              cppFlags.add("-I${file("/usr/local/include/eigen3/")}".toString())
              cppFlags.add("-I${file("../../tango_client_api/include/")}".toString())
              cppFlags.add("-I${file("../../third_party/glm/")}".toString())
              cppFlags.add("-I${file("../../third_party/glm/glm/")}".toString())
              cppFlags.add("-I${file("../../tango_gl/include/")}".toString())
              cppFlags.add("-I${file("../../tango_support_api/include/")}".toString())
              cppFlags.add("-std=c++11")
              cppFlags.add("-fexceptions")
              ldLibs.addAll(['GLESv2', 'log', 'android'])
          }
          sources {
              main {
                  java {
                      source {
                          srcDir "src"
                      }
                  }
                  jni
                  {
                      source
                      {
                          include "jni_interface.cc"
                          include "plane_fitting.cc"
                          include "plane_fitting_application.cc"
                          include "point_cloud_renderer.cc"
                          include "../../../tango_gl/bounding_box.cc"
                          include "../../../tango_gl/camera.cc "
                          include "../../../tango_gl/conversions.cc "
                          include "../../../tango_gl/cube.cc "
                          include "../../../tango_gl/drawable_object.cc "
                          include "../../../tango_gl/mesh.cc "
                          include "../../../tango_gl/shaders.cc "
                          include "../../../tango_gl/transform.cc "
                          include "../../../tango_gl/util.cc "
                          include "../../../tango_gl/video_overlay.cc"
                      }
                  }
              }
          }
      }
  }
  
  tasks.withType(JavaCompile) {
      compileTask -&gt; compileTask.dependsOn ndkBuild
  }
  task ndkBuild(type: Exec) {
      Properties properties = new Properties()
      properties.load(project.rootProject.file('local.properties').newDataInputStream())
      def ndkbuild = properties.getProperty('ndk.dir', null)+"/ndk-build"
      commandLine ndkbuild, '-C', file('src/main/jni').absolutePath
  }
  
  
  dependencies {
      compile 'com.android.support:support-v4:22.1.1'
      compile 'com.android.volley:volley:1.0.0'
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile project(':cpp_example_util')
  }
  </code></pre>
  
  <p><code>build.gradle</code>:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
  
      repositories {
          jcenter()
      }
  
      dependencies {
  //        classpath 'com.android.tools.build:gradle:2.2.0-rc1'
          classpath 'com.android.tools.build:gradle-experimental:0.7.3'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>