2017-07-24 42 views
0

我想在Android的Titanium模块中包含一个共享对象库(.so)。我们如何在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) 

但仍钛生成与include $(BUILD_SHARED_LIBRARY)Android.mk

是否有人在Titanium模块中成功使用了.so库?

回答

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> 

执行命令罐TF DIST/com.example.mymodule-android-0.1.zip来验证期望库文件已被添加到模块。

相关问题