Eclipse的Android包不包括来自库项目.so文件 [英] Eclipse android package does not include .so file from a library project
问题描述
下面是我的项目布局。
项目MyLib中 - Android的库项目。它包含创建libMyA.so JNI目录。
Project MyLib - Android library project. It contains jni directory that creates libMyA.so.
项目MyMain - Android应用程序的项目。在Eclipse中,我已经添加MyLib中的一个相关项目的属性 - > Android的 - >参考UI
Project MyMain - Android application project. In Eclipse, I have added MyLib as a dependent project from Properties-->Android-->Reference UI.
当Eclipse构建的.apk文件,问题是,它不包括libMyA.so
When Eclipse builds the .apk file, the problem is that it does not include libMyA.so.
作为一种变通方法,我可以手动复制MyLib中\\库\\ armeabi \\ libMyA.so到MyMain \\库\\ armeabi \\ libMyA.so。现在,.apk文件生成时,它包含的库文件。
As a workaround, I can manually copy MyLib\libs\armeabi\libMyA.so to MyMain\libs\armeabi\libMyA.so. Now, when the .apk file is built, it does contain the library file.
我想知道如果我错过了,我应该规定一些其他的设置。
I am wondering if I missed some other setting that I should have specified.
推荐答案
有关Eclipse用户,只有两个步骤需要:
在LIB项目名称1.设置库项目上单击右键 - >属性 - > Android的 - >标记库复选框。
For eclipse users,only two steps needed: 1. Set Library project by right-click on lib project name --> properties --> Android --> Mark "Is Library" checkbox.
2.In项目中使用的共享对象的引用添加到由libraray工程项目名称上点击右键> Android的 - >库/添加。
生成项目后,结果apk文件将包括这些。所以库。
2.In the project use the shared object, add a reference to the libraray project by right-click on project name --> properties --> Android --> Library/"Add". After you build the project ,the result apk file would include those .so libs.
这篇关于Eclipse的Android包不包括来自库项目.so文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!