2

(ADK 21、NDK r8d、Eclipse Juno)[我已经构建了几个 Android 应用程序,因此使用 ADK/NDK 等获得了不错的体验]

Eclipse 项目设置:

- AppProject (android, java, no jni)
- LibProject (android, java, Yes jni)

以前,所有这些都在一个项目中 - 构建良好,运行良好,并且本机调试效果很好。

然后,我将“可重用”部分拆分为一个通用代码库,用于多个“AppProject”应用程序前端。(一切仍然可以构建、链接、打包和运行)

但是,当我运行“AppProject”时,我无法再调试本机库。

解决办法是什么?

可能的选项#1:

- Modify "LibProject" Android.mk to export a PreBuilt that is used by AppProject?
- (I would have all the debug symbols so I'm thinking that would work okay)

我还需要对 AppProject 进行改造吗?换句话说,它有一个 Android.mk 来从 LibProject 导入输出 .so

可能的选项#2

- http://stackoverflow.com/a/14344377/735533
- that workaround uses ndk-gdb
- I'm hoping for a solution where I can debug LibProject in Eclipse directly when running AppProject

在运行主应用程序“AppProject”时,是否有更好的方法来调试位于依赖项目“LibProject”中的本机代码?

蒂亚

4

1 回答 1

0

对于那些好奇...

  • 我尝试了预建...
    • 这绝对是要走的路(测试项目设置工作)
    • 但是我的代码库的结构对原生/非原生串扰有点沉重,目前不想花时间(还)进行适当的重组。
    • 但是,作为预构建的重组现在在我的“重要待办事项”列表中

任何地方,这是我的解决方案。

在 Linux(unix 风格)上......使用链接 - 源链接到来自 LibProject 的每个 AppProject。

Basically the "LibProject" becomes a sort of "template" during development - it is not built or used as a library directly. Rather, each AppProject becomes self-sufficient, standalone, application with the contents of the library project embedded in its own code tree. Best part is native debugging works like a charm again.

Although it sort of defeats the point of making, there are benefits - one common codebase for the "library" portion ... which is really what I desire for the time being.

Also, conversion to use as a true Library dependency by the Application projects for, say, eventual release builds is an easy switch. Once debugged and ready, the Library can be built separately, packed normally with the application "front ends", and upgraded independently of the applications.

于 2013-04-04T03:09:33.637 回答