Tôi có hai Dự án Android 'A' và 'B'. 'B' phụ thuộc vào 'A' và là một Thư viện. Bất cứ khi nào tôi đang trong dự án 'B' và nhấn 'Khai báo mở' cho một tệp nguồn Java nằm trong 'A', Eclipse điều hướng đến tệp lớp thay vì tệp nguồn. Điều này tất nhiên có một số nhược điểm!'Khai báo mở' trong Eclipse điều hướng đến tệp lớp thay vì tệp nguồn cho Thư viện Android
Tôi đã xem xét đường dẫn xây dựng của dự án 'B' để xem thư viện được tham chiếu 'A' có đường dẫn chính xác đến dự án nguồn của nó hay không.
Bất kỳ ai biết cách khắc phục điều đó?
Sau đây là các classpath và project.properties file cho từng dự án:
PROJECTA 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 kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
PROJECTA project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
android.library=true
ProjectB 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 kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
ProjectB project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
android.library.reference.1=../ProjectA
Tôi đã thêm các tệp được yêu cầu nhưng tôi nghĩ điều đó không giúp ích gì nhiều. – Andreas
Các tập tin .classpath không hiển thị bất cứ điều gì trong số bình thường, vì vậy lý thuyết của tôi về việc có một JAR trên classpath không pan ra. Tôi sẽ thử xóa Project A dưới dạng phụ thuộc. Điều đó sẽ làm cho Project B xây dựng thất bại (nếu không, sử dụng Project> Clean). Sau đó, thêm dự án A trở lại làm phụ thuộc để xem điều đó có xóa mọi thứ không. Đây chỉ là nắm bắt tại ống hút, nhưng các plugin ADT dường như có một số lỗi kỳ lạ xung quanh xây dựng và phụ thuộc. –