I’m working with the Google Drive API in Eclipse and having trouble with source code access. I added the Drive API through the Add Google APIs... option and everything seemed to work fine at first.
The weird thing is that when I browse directly to the Drive API jars, I can see the source code without any issues. But when I try to access the same jar files through Android Private Libraries, I get a “Source not found” error message.
This becomes really annoying when I’m trying to use features like Open Declaration (F3) because it just shows the “Source not found” page instead of taking me to the actual code.
I noticed that the build process links everything through the Android Private Libraries system. I’ve tried looking for ways to attach source files or documentation to the Drive API but can’t find any working solution.
When I right-click and try to attach sources, all the attachment options appear grayed out and disabled. Has anyone encountered this issue before? What’s the best way to get source code access working properly for Google APIs in Eclipse?
I encountered a similar issue before. One solution that worked for me was to edit the .classpath file directly. Open the file in a text editor and locate the entries for the Google Drive API. You will need to add sourcepath="path/to/your/sources.jar" for each entry. Once you save the changes and refresh your project in Eclipse, the source code access through F3 should function properly. It’s a bit unconventional, but it often resolves these frustrating source attachment issues.
I struggled with that too! You might wanna check your project properties and see if the paths are set correctly. Sometimes, a clean build can help clear up those source issues. Also, ensure the correct libraries are linked in your build path.
Yeah, this is a pretty common Android Private Libraries issue in Eclipse. Eclipse handles Google Drive API jars weird when they go through the Android build system instead of direct access. I fixed it by manually copying the source jars to the libs folder and refreshing the project. You could also try completely removing the API from your project, then re-adding it with the Google Plugin for Eclipse (not the standard Add Google APIs option). Or just download the Google APIs Client Library for Java straight from Google’s dev site and add it manually to your build path - skip the automated system entirely.