Android Library project out of sync in Eclipse
I have an Android Library project with some Activities and Views, referenced by an Android Application project. The application project has a "linked" folder marked [Android Library] with the sources of m开发者_如何学JAVAy library project.
One thing that seems strange to me, is that the same source file can be opened twice, from the linked folder and from the original library folder. This often results in files being out on sync, and all sorts of nasty things happening.
Any idea of what's going wrong? Thanks in advance!
This is expected behavior. If the same physical folder is added multiple times via resource links, the synchronization state of each of the folders is tracked separately. Here are your options:
Deal with having to manually refresh folders from time to time.
Turn on auto-refresh under Window -> Preferences -> General -> Workspace -> Refresh automatically. I believe this performs ok Windows, but can be very slow on Linux. Actual performance likely depends on the size of your workspace.
Re-structure your projects such that you are not using linked folders to bring in library code. I don't know anything about Android development or ADT, but the standard approach for other Java apps is to add a dependency from app project to library project via Project Properties -> Java Build Path -> Projects.
Check your package name in Manifest file it should be same with your project package name.
精彩评论