android NDK问题汇总

  • android NDK r9编译问题

I put this in my Application.mk to solve the same problem.

APP_CFLAGS += -Wno-error=format-security 
- See more at: http://www.cocos2d-x.org/forums/6/topics/32437?r=33260#message-33260
  • Android NDK native method

Your package/class names do not match.

JNIEXPORT jstring JNICALL   Java_com_example_ndktesting_ndktest_MainActivity_invokeNativeFunction(JNIEnv* env, jobject  thiz)

Would be a method in the class

com.example.ndktesting.ndktest.MainActivity

 

  • Eclipse环境配置出现错误:

Eclipse环境新建环境出现如下错误:

Android NDK: jni/Android.mk: Cannot find module with tag 'CocosDenshion/android' in import path    

Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    

Android NDK: The following directories were searched:    

Android NDK:          jni/Android.mk:19: ***

Android NDK: Aborting.    .  Stop.

 

解决方案为:

在项目proj.androidjniAndroid.mk(E:Researchcocos2dcocos2d-2.0-x-2.0.2GameThievesproj.androidjniAndroid.mk)

文件中添加路径:

$(call import-add-path, E:Researchcocos2dcocos2d-2.0-x-2.0.2)

$(call import-add-path, E:Researchcocos2dcocos2d-2.0-x-2.0.2cocos2dxplatform hird_partyandroidprebuilt)
$(call import-module,CocosDenshion/android)

$(call import-module,cocos2dx)

$(call import-module,extensions)

参考http://blog.csdn.net/wangbofei/article/details/7951362

 

 
 

 

原文地址:https://www.cnblogs.com/aosting/p/3436366.html