After installing ADT, I used SDK Manager to download the source codes for the latest android API. Now when I run the Eclipse version that was provided with the ADT, I still can't see the android source codes.
Is there a simple way to fix this?
Open SDK Manager-->install source under api(i.e Android 4.0)
if You got No sources attached then click the button, then choose the Directory
e.g: D:\Android\android___sdk\sources\android-17\ ---> this my android sdk location
Depend upon your android installation directory choose accordingly.
After downloading the Sourcecode by useing the "Android SDK Manager", you have to change the settings in your eclipse-porject.
At first, just have a look where the Sourcecode has been downloaded. In my case (useing Windows 8) its here:
"C:\adt-bundle-windows-x86_64-20130219\sdk\sources\android-17"
Now go into Eclipse.
Open the "Properties" of the project (right click on the project-folder and click on "Properties").
On the left side click on "Java Build Path" and then click on the tab-page "Libraries".
Next you click on the right side on the button "Add External Class Folder...".
Select the folder where you find the sourcecode. In my case its the folder "android-17" of the path "C:\adt-bundle-windows-x86_64-20130219\sdk\sources\android-17".
Commit / close all windows with ok. (Maybe you should restart eclipse.)
And now you can see/read the Android-Sourcecode. (But only in the project which you have choosen before.)
First, you need to download them. Use Android SDK Manager -> Android X.Y.Z (API A) -> Sources for Android SDK.
Then, you need to attach the folder with the sources the next time you browse there: /sources/android-A
Previous answers are great but here you have a complete resource by Lars Vogel who address this question. I hope it may be useful as well as it was for me.
I found this for me:
For main lib: android.jar:
src: sdk/sources/android-19
doc: sdk/docs/reference/
For support lib: android-support-v4.jar:
(before this we should add android-support-v4.jar like external jar (Project Properties -> Java Build Path -> Libraries, then in Tab ‘Order and Export’ pull up this library before Android Private Libraries))
src: sdk/extras/android/support/v4/src/java
doc: http://developer.android.com/reference/android/support/v4/app/package-summary.html (not sure)
Related
I have tried all the threads related to errors while integrating FB-SDK but was not successful , any answers are welcomed .
My Java Compiler is set to 1.6.
I get this error while integration the Facebook SDK to my App
it is giving me the error at that marked place as
path\facebook-android-sdk-3.0.2\facebook\bin(missing)
i get this error after added this by clicking OK .
Thanks in Advance .
Before moving on, I recommend you to get latest Facebook SDK, because there are some important changes between yours (3.0.2) and 3.0.
Here's what I do to import Facebook SDK
1- Download the latest SDK, extract it to a directory, i.e. X. (~/X)
2- Open Eclipse, New Project -> Android Project From Existing Code, then browse and choose ~/X/facebook-android-sdk-3.0 as root directory
3- Select only "facebook" project and click finish
4- Right click to facebook project -> properties. Choose Compiler Compliance level as 1.6 from Java Compiler section
5- Create new android project, and set it's compliance level 1.6 as well. Also in Android section of Project Properties, Click add button, and choose facebook project (that we imported in Step 3)
6- Finally, Project -> Clean. For me this works like a charm all the time.
Have you checked if you have the facebook jar inside your fb-sdk/bin folder? If it's not there, do a clean and build procedure first in your fb-sdk folder. It will produce a facebook.jar file on your bin folder.
After that, then, you may already do another clean and build on your main project folder.
I found here already a few posts for this problem but also with this help I dont get it running on my machine.
I want to attach the android source code to the android.jar. I tried a few ways but somehow it does not show any android source code. Here is my folder structure where my android sdk is
Image here http://pasteboard.s3.amazonaws.com/images/111OkUca.png
Even if I attach the folder of the requested android-16 plattform it wont show the source.
image here http://pasteboard.s3.amazonaws.com/images/1125INcC.png
What is my mistake?
Thanks
You can download the Java 7 javadoc from
http://www.oracle.com/technetwork/java/javase/documentation/java-se-7-doc-download-435117.html
if you have the "Documentation for Android" package and the javadoc info still isn't showing up, make sure the Android library settings point to the right folder:
Project -> Settings -> Java Build Path, Libraries tab
Android X.X -> Android.jar -> Javadoc Location:
Should be something like "sdk_root/docs/reference/".
And to view the docs for a class in editor for example:
you should choose show attached java doc in web browser from to popup that appear when hover the cursor on some declaration.
I have tried to use this tutorial and when I clicked finished, I have noticed that the src was empty, screenshot below: The facebook project in my folder is complete, so my question do I need to manually copy all the files to the folder? And why was this empty?
Edited:
I'm using Eclipse Indigo and Android ADT Version 18.
After you have created your project with empty folders do the following:
1) Right Click on the project
2) Click Import
3) General > File System
4) Select the "facebook" folder that is inside the downloaded package
5) Check mark the facebook option
6) Finish
This will import all the files that are part of the facebook project.
Aside from this tutorial as this method is somewhat chaotic, there's some other way by going to Right-clicking your project -> Build Path -> Link Source -> Browse to the "facebook" directory, and that's it, hope it gave you all some idea.
I've previously had success attaching the Android Source to Eclipse by following Finn Johnsen's instructions here.
However this approach seems to have stopped working:
samuel-josephs-computer-4:android-sources samueljoseph$ git checkout origin/froyo-release
Previous HEAD position was 1de4a2c... am 62619392: Merge "Fix leak when keylock is recreated."
HEAD is now at adba66b... This class no longer exists.
There was a more recent blog here which had some pre-organized source for Eclair, but nothing since.
There are also some StackOverflow posts from 2008 (older than both the above), e.g.
https://stackoverflow.com/questions/3182904/attaching-java-source-to-android-projects-in-eclipse.
What is the current guidance for accomplishing this?
There is a updated guide. So, you don't need to install an eclipse plugin for this.
Here is the link
Snip from above Link:
follow below steps if you already have downloaded Android sources
Head into eclipse, and press F3 over some android source you're missing, like Activity. And get this pesky window, which we all hate:
Click Attach Source, choose External Folder, and choose the core/java in the base folder.
There is an Eclipse plugin called Android Sources that installs the sources up through Gingerbread. I haven't tried it recently.
For Android 4+ here's a tutorial for attaching sources to eclipse.
EDIT:
First download the source and javadoc from sdk manager.
Goto Your_Project>>Android XXX, Right-Click on android.jar and select Properties.
Point the sources path as Java Source Attachment>>Location Path by clicking on External Folder
Point the reference path as Javadoc Location>>Javadoc Location Path by clicking on Browse
Now you can browse sources like this:
Here's a tutorial:
Make sure you have installed/downloaded the Android source for the appropriate Android SDK API version.
1.1 Check the API version you have specified in Eclipse for Android/Project Build target:
Open project Properties/Java Build Path and click the "Link Source..." button on the Source tab:
Point to where you have installed the Android SDK, expand the "sources" folder, select the appropriate source API version (and click "OK"):
Next...:
Important step is to exclude the whole linked source from building. Otherwise we could have some duplicate source errors plus who wants to build the whole Android source when we have jars already! So, click "Add...", type in *, click "OK" (and then "Finish"):
Verify everything is configured correctly:
Desired result -- linked platform source w/o side effects:
I hope this helped :)
The best way is as below.
Update Android SDK Manager, including source of the version you need.
click on Any class like activity, if source is properly attached, it will open the Activity class.
If it is not opening up, then click on the attach source and can give source path as above.
Source path will be like android-sdk-windows\sources\android-17
This will help you to add source for android SDK
You can do it this way .... hover or copy paste any class_name which is provided from android , just press F3 you will find a Attach_a_source tag there , click in it & here browse your android-sdk folder
and from it just pick source folder because inside it , every android files resides .
I finally was able to build and debug the android platform with this tutorial. I imported my project in eclipse, and afterwards installed ADT. Then I converted my imported project to android project (Android Tools -> Convert To Android Project). And now I'm having Failed to load properties file for project 'droid-platform' error. Session data:
eclipse.buildId=M20100211-1343
java.version=1.5.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=ru_UA
Command-line arguments: -os linux -ws gtk -arch x86
Does anyone know, how do I deal with this?
Use the contextual menu on the Project in error, "Android Tools"-->"Fix project properties", I also tried "Refresh (F5)" in the same pass, than it worked again.
ADT does not work good with the platform itself. Actually, the platform is not an android project itself.
I really struggled with this one and finally solved it using the solution here:
"Debug certificate expired" error in Eclipse Android plugins
I also had the error message you mention, but somehow, deleting the keystore fixed everything.
p.s. do a clean after deleting the keystore.
Yusuf
The solution to this problem is to setup some System Environment Variables.
Right click on "My Computer" and select "Properties"
Select the "Advanced" tab
Click the "Environment Variables" button
Under "System Variables" find "Path", select is and then click "edit"
Scroll to the far right, now you need to add two paths, "C:\Documents and Settings\YOUR_USER_NAME\.android\avd" and "C:\Program Files\Java\jdk1.7.0_01\bin", you need to add a ; at the end of each path. Click "Ok" when done.
Select the "New" button, for variable name enter "ANDROID_SDK_HOME", and for variable value enter your SDK install path (Default is "C:\Program Files\Android\android-sdk") and then click "Ok"
Restart Eclipse and it should work!
on my mac, with Eclipse and the Android AVD exited,
1) i deleted all projects in my workspace (backup first!),
2) recreated it with the same workspace name and
3) finally restarted eclipse and a new project setup works fine without the "Failed to load properties.." msg.
So easy just choose the project that has an error, and then go to menu>project>build Project
Just create a new file called project.properties in the root of your project.
Add the line:
target=android-10
Or modify it to whatever version of the Android you're targeting.
I got the a similar error When following the Notepad tutorial on the Android Developers website, the first step in Exercise 1 is to create the first project by going to
File->New->Android Project-> "Create project from existing source"
The problem is that when you select the Notepadv1 path to create the project from existing source, Eclipse will take the project out of the parent folder and move it up a level. For example, if you select
C:\workspace\NotepadCodeLab\Notepadv1
... as the existing source, Eclipse will copy all the contents of that subfolder except the AndroidManifest.xml (and Android.mk file) into a new folder one level up, eg.
C:\workspace\Notepadv1
So one workaround is to create the project, close Eclipse, then copy in all the missing files from the old subfolder to the new folder, then open Eclipse again and refresh the folder.
Presto, no more missing files.
In my case, I just add to import the R.java (ex:import com.exercise.teste.R;) to my class files by right clicking on ex: R.id.mybutton and choose import ex; your.package.name.R, then CLEAN, BUILD.
What fixed the problem for me was going into eclipse sdk manager and installing the tools there even though I had them installed on my sdk manager. It seems that there 2 separate sdk managers with different files, so try directly going into the sdk manager in Eclipse and seeing if you have the tools installed there.
I had the same problem, and without installing AUSKey only corrected the error by removing the log4j.jar / Library / Java / Ext on Windows (\C:\Program Files\Java\jre7\lib\ext) was fixed. In my case, the solution was like this:
https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=54452
I had this error when I manually tried editing the manifest file, "AndroidManifest.xml". When I made changes using the little GUI provided for editing the file, it works fine.
Make changes via the Manifest General Attributes and Manifest Extras sections that opens up when you double click the "AndroidManifest.xml" file. Yet beware of changes made directly to the xml, even if they are identical!
I was facing the same issue but I finally got the solution:
Right-click on your Eclipse project.
Go to Build Path->Configure Build Path->select Android from left side.
In Library section select and remove the existing v7 library
Add it again from your imported v7 project.