【问题标题】:How do we use .so libraries in Titanium module?我们如何在 Titanium 模块中使用 .so 库?
【发布时间】:2017-07-24 16:08:59
【问题描述】:

我正在尝试在我的适用于 Android 的 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 仍会生成带有 include $(BUILD_SHARED_LIBRARY) 的 Android.mk。

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

【问题讨论】:

    标签: android titanium


    【解决方案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 验证所需的库文件是否已添加到模块中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-15
      • 2016-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多