我正在尝试在我的Titanium模块中包含一个共享对象库(.so
)。
我已将两个.so
文件包含在以下文件夹中:
android/lib/armeabi
android/lib/armeabi-v7a
android/lib/x86
android/jni/armeabi
android/jni/armeabi-v7a
android/jni/x86
android/jniLibs/armeabi
android/jniLibs/armeabi-v7a
android/jniLibs/x86
当我尝试构建我的模块时,我在控制台中收到了一条消息:
[exec] Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
[exec] Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
[exec] Android NDK: current module
总的来说,我的构建没有发生,但是这条消息告诉了我什么?我在Android.mk
文件中尝试了以下所有内容:
include $(LOCAL_STATIC_LIBRARIES)
include $(LOCAL_SHARED_LIBRARIES)
include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
include $(PREBUILT_SHARED_LIBRARY)
但Titanium仍会生成Android.mk
include $(BUILD_SHARED_LIBRARY)
。
是否有人在Titanium模块中成功使用了.so
库?
答案 0 :(得分:1)
我相信此链接提供了您正在寻找的参考:gist with shorts steps
以下是内容:
来自:http://developer.appcelerator.com/question/121573/how-do-i-use-so-library-in-module
将.so文件放在mymodule / lib / armeabi
中将此添加到build.xml:
<target name="post.jar">
<copy todir="${libs}">
<fileset dir="lib">
<include name="**/*.so"/>
</fileset>
</copy>
</target>
运行: jar tf dist / com.example.mymodule-android-0.1.zip 以验证是否已将所需的库文件添加到模块中。