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

【未解决】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 belong 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,根本无法手动加源码:

libraries android dependencies usb serial jar source attachment none modifiable

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:

current adt version is 21 not 17

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

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

根本找不到什么Build Path:

right click usb serial jar not build path

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

usb serial lib properties not build path

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

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

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

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

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

debug mode right click thread edit source lookup

Default->Add->Java Project

edit the source lookup path default add java project ok

choose related source code project then ok

added usb serial project then ok

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

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

then redo debug f5 can into source code for usb serial prober

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

项目中,新建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之类的),应该也是可以添加源码的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值