android引入外部项目点击不能查看源码问题
2014-12-11 13:52
543 查看
当我手动创建一个Android项目(暂且叫项目A),然后由另外一个项目(暂且叫项目B)引用这个项目的时候,在项目B中使用了项目A的类时,此时使用ctrl+鼠标左键是可以定位到项目A的源码的。
但是当我再复制一个项目A(复制的项目叫做项目C),由项目B引用项目C的时候,在项目B中使用了项目C的类时,此时使用ctrl+鼠标左键是不能找到源码的,这个问题很奇怪,纠结了好久,终于找到答案了,现在观察一下项目A的.classpath文件
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
再来看看复制出来的项目C的.classpath文件
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
发现除了位置之外,其他的好像没什么区别,于是将项目C也换成项目A这样的位置顺序,clean项目一下,然后再看,果然可以关联了。
查看被依赖工程的class path 文件,发现如果某个工程可以debug,那么<classpathentry kind="src" path="src"/> 一定在<classpathentry kind="src" path="src_gen"/> 的前面,因此修改这两个配置属性的位置,将<classpathentry
kind="src" path="src"/>放在class path 属性列表的最上边,保存并clean工程,重新debug。问题解决,可以正常查看源码。
但是当我再复制一个项目A(复制的项目叫做项目C),由项目B引用项目C的时候,在项目B中使用了项目C的类时,此时使用ctrl+鼠标左键是不能找到源码的,这个问题很奇怪,纠结了好久,终于找到答案了,现在观察一下项目A的.classpath文件
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
再来看看复制出来的项目C的.classpath文件
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
发现除了位置之外,其他的好像没什么区别,于是将项目C也换成项目A这样的位置顺序,clean项目一下,然后再看,果然可以关联了。
查看被依赖工程的class path 文件,发现如果某个工程可以debug,那么<classpathentry kind="src" path="src"/> 一定在<classpathentry kind="src" path="src_gen"/> 的前面,因此修改这两个配置属性的位置,将<classpathentry
kind="src" path="src"/>放在class path 属性列表的最上边,保存并clean工程,重新debug。问题解决,可以正常查看源码。
相关文章推荐
- Android 无法查看外部依赖jar的源码的问题
- Xcode项目引入外部文件夹,不能引用问题
- eclipse 点击查看源码不能查看问题
- Xcode项目引入外部文件夹,不能引用问题
- Xcode项目引入外部文件夹,不能引用问题
- 解决谷歌为Android系统提供的支持库android-support-v4。jar不能绑定查看源码的问题
- Android 无法查看外部依赖jar的源码的问题
- 点击查看外部依赖jar的源码报找不到 android private libralies does not allow modifications to source
- Android 无法查看外部依赖jar的源码的问题
- Android 无法查看外部依赖jar的源码的问题
- The JAR of this class file belongs to container 'Android Private Libraries' Android查看外部依赖jar的源码问题解
- Xcode项目引入外部文件夹,不能引用问题
- Android控件listView条目不能点击问题
- 移植Eclipse下的Android项目到Ubuntu源码环境下碰到的问题
- 【技术直通车】Android中不能解析GIS类的XML文件或不能引入GIS类问题
- 处理ShowModelDialog弹出窗口不能查看页面源码的问题
- Android4.04下载源码图解~解决公网IP不能直接访问问题
- android开发中,项目里的文件不能导出到本地问题
- 关于android项目导入外部jar包的问题
- [转]Android项目源码混淆问题解决方法