Gradle couldn’t find Android_ native_ app_ glue

I have a native library. I try to build it with gradle. If I call the NDK build command from the gradle file, I can build the native library. However, if I try to use the built-in NDK build function in the Android gradle plug-in, I can't build it

I got a fatal error: Android_ native_ app_ Glue. H: there is no such file or directory

The relevant parts of the gradle file are:

buildTypes.debug.jniDebugBuild true

defaultConfig {
    ndk {
      moduleName 'myModule'
      stl 'gnustl_static'
      cFlags '-UNDEBUG -Werror -Wunused-variable -Wunused-but-set-parameter -Wtype-limits -Wmissing-field-initializers -Wreturn-type -Wuninitialized'
      ldLibs 'log', 'GLESv2'
    }
    productFlavors {
      armv7{
        ndk {
          abiFilter 'armeabi-v7a'
        }
      }
    }
}

Is there any way to tell NDK where to find Android_ native_ app_ Glue. H file?

In addition, is there a way to pass the detailed flag to NDK build, which is equivalent to NDK build v = 1?

resolvent:

I have the same problem. I fix it by adding "- I {path_to_android NDK} / sources / Android / native_app_glue" to cflags. See here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>