创建产品 SDK:如何使用正在创建的 SDK 添加本机库 (.so) 和 jar? [英] Creating a product SDK: How do I add a native lib (.so) and a jar with the SDK I am creating?
问题描述
我正在创建一个我们将提供给开发人员最终用户的小部件,它由一个 .jar
和一个使用 NDK 构建的本机库 (.so
) 组成.JAR 有一个到动态库的 JNI 接口.
I am creating a widget that we will provide to developer end users and it consists of a .jar
and a native library (.so
) built using the NDK. The JAR has a JNI interface to the dynamic library.
关于如何在项目中包含外部.jar
非常清楚,但不知道如何包含依赖的动态库.
It's very clear on how to include an external .jar
in a project but not how to include a dependent dynamic library.
如何打包和构建
.jar
和.so
?这里有哪些最佳实践?
How do I package up and build the
.jar
and.so
? What are the best practices here?
我可以使用 JDK 的 jar 命令创建 JAR 文件.我是否需要在 jar 上运行 dx.bat 才能转换为 Dalvik 字节码?
I can create the JAR file using the JDK's jar command. Do I need to run dx.bat on the jar to convert to Dalvik bytecode?
我需要创建一个示例项目来展示小部件的运行情况.如何在演示如何使用小部件的示例项目中包含此 .jar
和 .so
?
I need to create a sample project showing the widget in action. How do I include this .jar
and .so
in a sample project that demonstrates how to use the widget?
推荐答案
我花了一些时间在这上面,我只是不明白为什么这不是写在 wikitude 文档上的......无论如何都要遵循这个变化!
I spent some time on this, and i just can't understand why isn't this written on wikitude documentation.... anyway follow this changes!
- 转到 windows/preferences/android/build
- 取消选中第一个和第二个选项
- 用winrar从wikitudesdk.jar中提取文件,就像它是一个档案一样,搜索libarchitect.so并将其复制到/libs/libs/armeabi/中
- 将 wikitudesdk.jar 添加到您的构建路径
这篇关于创建产品 SDK:如何使用正在创建的 SDK 添加本机库 (.so) 和 jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!