Skip to main content



      Home
Home » Newcomers » Newcomers » Source not found(the source attachment does not contain the source for the file)
Source not found [message #725892] Fri, 16 September 2011 02:01 Go to next message
Eclipse UserFriend
Hello,

I am newbie to Eclipse. I am working on Android and Eclipse on the linux ubuntu platform.

I am trying to write a program for Server-Client socket communication.
Below is the code snippet:

try{
Log.d(LOG_TAG, "OK");
providerSocket = new ServerSocket(8000, 10);
connection = providerSocket.accept();

boolean a = connection.isConnected();

Toast.makeText(this, "Connection established!",
Toast.LENGTH_LONG).show();
return;
}
catch(IOException e)
{
Log.v(LOG_TAG, "NOK");
e.printStackTrace();
}

When i debug the code, it reaches at connection = providerSocket.accept(); and stops debugger by showing below message
Source Not found
The source attachment does not contain the source file ServerSocket.class
You can change the source attachment by clicking Change Attached Source below:

When i try to click on button i dont find any source file src.zip in the directory of Android.
Eclipse does have src.zip but in many folders so i am confused to choose which file to be selected.

Any other clues??

Prasad
Re: Source not found [message #725907 is a reply to message #725892] Fri, 16 September 2011 02:57 Go to previous messageGo to next message
Eclipse UserFriend
On 16.09.2011 08:01, Prasad wrote:
> Hello,
>
> I am newbie to Eclipse. I am working on Android and Eclipse on the
> linux ubuntu platform.
>
> I am trying to write a program for Server-Client socket communication.
> Below is the code snippet:
>
> try{
> Log.d(LOG_TAG, "OK");
> providerSocket = new ServerSocket(8000, 10);
> connection = providerSocket.accept();
> boolean a = connection.isConnected();
> Toast.makeText(this, "Connection
> established!",
> Toast.LENGTH_LONG).show();
> return;
> }
> catch(IOException e) {
> Log.v(LOG_TAG, "NOK");
> e.printStackTrace();
> }
>
> When i debug the code, it reaches at connection =
> providerSocket.accept(); and stops debugger by showing below message
> Source Not found
> The source attachment does not contain the source file ServerSocket.class
> You can change the source attachment by clicking Change Attached
> Source below:
>
> When i try to click on button i dont find any source file src.zip in
> the directory of Android. Eclipse does have src.zip but in many
> folders so i am confused to choose which file to be selected.
>
> Any other clues??
You first need to figure out from which library that code comes and then
get the source for it.

Dani
>
> Prasad
Re: Source not found [message #725922 is a reply to message #725907] Fri, 16 September 2011 03:44 Go to previous messageGo to next message
Eclipse UserFriend
It is packed in the android.jar file.
I think java and android libraries are bundled in the same .jar file.

I even tried to reassigning path to android.jar file but still not working

[Updated on: Fri, 16 September 2011 03:45] by Moderator

Re: Source not found [message #725947 is a reply to message #725922] Fri, 16 September 2011 05:01 Go to previous messageGo to next message
Eclipse UserFriend
On 16.09.2011 09:44, Prasad wrote:
> It is packed in the android.jar file.
> I think java and android libraries are bundled in the same .jar file.
No. Java comes from Oracle in is in the Java JRE (or better SDK if you
want the source too). Android comes from Google and hence you need to go
there to get the sources. I would expect that the Android source comes
along with the Android SDK.

Dani
Re: Source not found [message #725998 is a reply to message #725947] Fri, 16 September 2011 07:32 Go to previous messageGo to next message
Eclipse UserFriend
I am basically not able to understand is this a problem of Android or Eclipse?
Other Android code is working fine. Only perticular statements create problem.
Re: Source not found [message #726010 is a reply to message #725998] Fri, 16 September 2011 07:47 Go to previous messageGo to next message
Eclipse UserFriend
On 16.09.2011 13:32, Prasad wrote:
> I am basically not able to understand is this a problem of Android or
> Eclipse?
> Other Android code is working fine. Only perticular statements create
> problem.
If the class is from Android then it is an Android problem.

Dani
Re: Source not found [message #726085 is a reply to message #725998] Fri, 16 September 2011 10:12 Go to previous messageGo to next message
Eclipse UserFriend
On 16-Sep-11 05:32, Prasad wrote:
> I am basically not able to understand is this a problem of Android or
> Eclipse?
> Other Android code is working fine. Only perticular statements create
> problem.

Prasad, there are good Android forums:
http://www.javahotchocolate.com/tutorials/android.html#support
Re: Source not found [message #726141 is a reply to message #726085] Fri, 16 September 2011 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Thanks!
Hope it solves my problem.
Re: Source not found [message #727188 is a reply to message #725922] Tue, 20 September 2011 11:18 Go to previous message
Eclipse UserFriend
On 9/16/11 3:44 AM, Prasad wrote:
> It is packed in the android.jar file.
> I think java and android libraries are bundled in the same .jar file.
>
>

Install the Android Sources plugin and you'll be able to view much of
the code for android.jar classes: http://code.google.com/p/adt-addons/
(scroll down to the section "Android Sources."

Eric
Previous Topic:indexer search path
Next Topic:alt + shift + down arrow equivalent
Goto Forum:
  


Current Time: Sat Jul 12 18:32:38 EDT 2025

Powered by FUDForum. Page generated in 0.12273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top