android - Gradle is not compiling using ndkBuild -


i have android project configured in eclipse works ant , ndk-build customized android.mk , application.mk files. need move them android studio , don't want use cmake comes it, want keep old .mk files. started simple hello world example following code:

here native-lib.cpp:

#include <jni.h> #include <string>  extern "c" {  jstring java_com_comscore_android_app_mainactivity_stringfromjni(         jnienv* env,         jobject /* */) {     std::string hello = "hello c++ lalalaaaaaa";     return env->newstringutf(hello.c_str()); } } 

and here gradle file:

android {     compilesdkversion 23     buildtoolsversion "24.0.1"     defaultconfig {         applicationid "com.comscore"         minsdkversion 10         targetsdkversion 23         versioncode 1         versionname "1.0"         testinstrumentationrunner "android.support.test.runner.androidjunitrunner"         externalnativebuild {             ndkbuild {                 arguments "ndk_application_mk:=src/main/jni/application.mk"             }         }     }     externalnativebuild{         ndkbuild{             path "src/main/jni/android.mk"         }     } ... } 

here android.mk file:

local_path := $(call my-dir)  include $(clear_vars)  local_src_files := native-lib.cpp local_module    := native-lib   local_ldlibs := -llog  local_cppflags += -fsigned-char -fexceptions -frtti -g -o0 -std=c++0x -std=gnu++0x  local_cflags += -fsigned-char -fexceptions -frtti -g -o0 -std=c++0x -std=gnu++0x   include $(build_shared_library) 

and application.mk:

app_abi := app_stl := gnustl_static 

but c code never compiled, body me issue?

thanks!

it not compiling anything, problem. solved after cleaning build folder manually


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -