Android - 调试引用的项目问题 [英] Android - Debugging referenced project problem

查看:131
本文介绍了Android - 调试引用的项目问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse Helios中有3个项目。

I have 3 projects in Eclipse Helios.


  1. A(java项目)

  2. B (Android图书馆项目)

  3. C(Android应用程序项目)

引用设置为这个:
B引用A和C引用B。

The references are set like this: B references A and C references B.

在我在项目C中的活动中,我创建了一个在我的项目中的类的一个instace A.
我在这一行和项目A中的类构造函数中设置一个断点。

In my activity in project C i created an instace of a class thats in my project A. I set a breakpoint on this line and in the class constructor in project A.

我打了调试,我收到异常调用目标异常 - 类文件编辑器:源程序没有被发现,应用程序崩溃,项目A中的断点从未被击中。

I hit debug and i get exception "Invocation target exception" - Class File Editor: Source not found.And the app crashes, breakpoint in project A never gets hit.

如果我直接在项目C中直接投标项目A,那么两个断点都将被击中在第一个断点之后进行)。但是如果我进入项目A,我得到相同的错误。

If i referece project A directly in project C both breakpoints get hit (only if i hit proceed after the first breakpoint). But if i step into project A i get the same error.

我做错了什么?

推荐答案

我有完全相同的结构A - Java项目(commonlibs),B Android Lib项目(ndkfoo2)和C Android应用程序。

I have exactly the same structure A - Java project (commonlibs), B Android Lib Project(ndkfoo2) and C Android App.

您必须确保在C属性中仅引用Android部分中的Library项目,而不是在Java构建路径中引用它。我犯了这个错误。也不要在这里处理B中的任何A。

You have to make sure in the Properties for C you only reference the Library project in the Android section and not reference it in the Java build path too. I made that mistake. Also no reference to A should be here either that is handled in B.

然后在B中引用A,你应该很好去。只有问题您才会调试到您的A项目中,似乎在eclipse中有一个错误,阻止您将源设置为Android中的分层项目。

Then just reference A in B and you should be good to go. Only issues you will have is debugging into your A project seems there is a bug in the eclipse that prevents you from setting your source to layered projects in Android.

这篇关于Android - 调试引用的项目问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆