Gradle NDK build cannot find header files included in the ndk and sdk distributions

251 views
Skip to first unread message

GG

unread,
Oct 7, 2014, 12:33:12 AM10/7/14
to gradle-androi...@googlegroups.com
Gradle 2.1
android-gradle-plugin: 0.13.3
OS: OSX

I have a project that includes an NDK build in a submodule. The build fails with error:  fatal error: tgmath.h: No such file or directory

In the build.gradle for the failing submodule I have:


apply plugin
: 'com.android.library'

repositories
{
  mavenLocal
()
  mavenCentral
()
}

dependencies
{
  compile fileTree
(dir: 'libs', include: '*.jar')
}

android
{
  compileSdkVersion
18
  buildToolsVersion
"19.1.0"

  useNewNativePlugin
true
  ndk
{
    moduleName
"hardware-abstraction"
    stl
"stlport_static"
 
}
}




My local.properties file:

sdk.dir=/Applications/Android\ Studio.app/sdk
ndk.dir=~/opt/android-ndk-r10b




The header file that can't be found, tgmath.h, is installed in many locations on my system:


/Applications/Android Studio.app/sdk/build-tools/17.0.0/renderscript/clang-include/tgmath.h
/Applications/Android Studio.app/sdk/build-tools/19.0.2/renderscript/clang-include/tgmath.h
/Applications/Android Studio.app/sdk/build-tools/19.1.0/renderscript/clang-include/tgmath.h
/Applications/Android Studio.app/sdk/build-tools/android-4.4W/renderscript/clang-include/tgmath.h

~/opt/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.6/include/tgmath.h
~/opt/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.6/include/tr1/tgmath.h
~/opt/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.8/include/tgmath.h
~/opt/android-ndk-r10b/sources/cxx-stl/gnu-libstdc++/4.8/include/tr1/tgmath.h
~/opt/android-ndk-r10b/sources/cxx-stl/llvm-libc++/libcxx/include/tgmath.h
~/opt/android-ndk-r10b/toolchains/llvm-3.3/prebuilt/darwin-x86_64/lib/clang/3.3/include/tgmath.h
~/opt/android-ndk-r10b/toolchains/llvm-3.4/prebuilt/darwin-x86_64/lib/clang/3.4/include/tgmath.h
~/opt/android-ndk-r10b/toolchains/renderscript/prebuilt/darwin-x86_64/lib/clang/3.3/include/tgmath.h


Reply all
Reply to author
Forward
0 new messages