您的位置:首页 > 移动开发 > Android开发

【已解决】Android的ADT调试期间出现提示:The Jar of this class file belongs to container ‘Android Dependencies’ whic

2014-09-11 10:43 609 查看
【未解决】Eclipse的ADT中调试Android程序时给jar包添加源码以便源码级调试

当看不到Class File Editor中可以显示让自己选择源码的是,就有对应的:
The Jar of this class file belongs to container ‘Android Dependencies’ which does not allow modifications to source attachments on its entries


所以要去搞清楚到底是什么意思。

The Jar of this class file belongs to container ‘Android Dependencies’
which does not allow modifications to source attachments on its entries
D:\DevRoot\xxxx\TFS_Root\Main\src\MobileHandHeld\libs>touch usb-serial-for-android-v0.2.1-pre.jar.properties

D:\DevRoot\xxxx\TFS_Root\Main\src\MobileHandHeld\libs>


想要接着加src和javadoc配置呢,

突然发现,此处我这里,根本就没有对应的source.jar的包。

所以没法直接加上述类似的配置。

2.后来自己去找到对应的dependencies的位置,结果却发现,source attachment,根本无法手动加源码:



The jar of this class file belongs to container ‘Android Dependencies’
which does not allow source modifications to source attachments on its entries

去确认了自己的ADT版本,是21,不是17:



无法查看第三方jar包源码解决

usb-serial-for-android-v0.2.1-pre.jar

根本找不到什么Build Path:



包括对应的Property中,也没有什么Build Path:



Android ADT 18+ 添加第三方源码包挂载以及查看问题解决

不要把jar放在libs,而放在lib中,就可以去通过Build Path添加源码了。

我此处,不希望去改动目录结构,必须还是把jar要放在libs中。

eclipse 遭遇及解决 debug调试时 因Android Dependencies而Source not found

去Debug视图下,右击线程,选择:



Default->Add->Java Project







当前Class File Editor界面中,并不会变化,还是不能同步看到源码。

继续调试,或者说,重新调试,再去单步F5执行的话,就可以看到源码了:



如此,真正的,解决了此问题。

项目中,新建lib文件夹,把对应的jar,从默认加入到的libs文件夹中,移到这个lib文件夹

然后右击对应的jar,然后通过Build Path,去添加对应的源码。

在调试期间,即Debug视图下,

右击那个Debug的Tab中的当前的Thread

Edit Source Lookup->Default->Add->Java Project->选择你的jar所对应的源码所在的项目->OK->OK

再继续debug或者是重新debug,即可实现:F5可以进入对应的源码,进行源码调试了。

即使你没有源码所对应的项目,估计通过添加对应的文件夹(Absolute File Path或File System Directory之类的),应该也是可以添加源码的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐