一:假设.so文件名称 : libhi.so

 

1.jni文件下创建一个prebuilt

 

2.android.mk文件中找到  include $(CLEAR_VARS), 在这句后面添加如下代码

 

include $(CLEAR_VARS)

LOCAL_MODULE := libhi

LOCAL_SRC_FILES := prebuilt/libhi.so

include $(PREBUILT_SHARED_LIBRARY)

LOCAL_SHARED_LIBRARIES := libhi

 

 

3.java中调用 

   

    static {

    

        System.loadLibrary("hi");

    

        System.loadLibrary("cocos2dcpp");

    } 

 

注意细节:

1.有的地方需要前缀:lib,有的地方不需要

2.有的地方需要后缀 .so 有的地方不需要

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案