The Jar of this class file belongs to container &#

2019-01-13 04:32发布

I am making an email application which is giving the error in this question's title. How can I fix this problem? I am giving my codes screenshot if it is helps to find solution.

enter image description here

7条回答
在下西门庆
2楼-- · 2019-01-13 05:03

I finally found the real and most simple solution to this.

THIS IS USING THE IDE, AND WILL ALWAYS WORK. THE SIMPLIEST SOLUTION.

If you have a complex structure where one library project use a library, and that library project is used for your project, and so on. Or in any case... do this to solve this problem:

Import to eclipse the library you want to be able to see the source code for debugging proccess.

Mark the Is Library Option by Right Clicking the project > Propertie > Android

Then go to all the library projects that uses that library, and Right Click the project > Propertie > Android > Add > and select your library.

Then, go to your project and the library project that is in the Project>Properties>Android>Library_name, click remove and add it again, in order to be able to assume the changes in the library project.

And that's all. It's just use the project of the library itself instead of just using the jar of the library you want to see the source code.

查看更多
Fickle 薄情
3楼-- · 2019-01-13 05:04

Had the same problem while using javax.mail to access gmail. According to this link (http://stackoverflow.com/questions/6546926/could-not-find-class-error-when-trying-to-upload-a-video-to-youtube-using-the-gd), there seems to be some sort of problem with it and Android.

I solved it by using this JAR files, here : http://code.google.com/p/javamail-android/

查看更多
劫难
4楼-- · 2019-01-13 05:07

Also try this one solution: go to project folder and open .classpath file. Here re-order classpathentry in this way

<?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>

First is <classpathentry kind="src" path="src"/> and second - <classpathentry kind="src" path="gen"/>. In my case it resolves all problems.

查看更多
劳资没心,怎么记你
5楼-- · 2019-01-13 05:10

When you use eclipse, you can fix it by selecting your library project and go to Properties > Order and Export and move your src dependency above the gen dependency. You can also manually edit your .classpath file to do the same. Source attachments should work after you clean this project. Credits for figuring out the solution goes to NightCrawler

查看更多
放荡不羁爱自由
6楼-- · 2019-01-13 05:13

Seems to be something they intentionally broke in ADT r17. See http://code.google.com/p/android/issues/detail?id=27490#c6.

查看更多
SAY GOODBYE
7楼-- · 2019-01-13 05:13

Notice the workaround in comment 8

http://code.google.com/p/android/issues/detail?id=27490#c8. "Hello, I have solution to problem described in a comment 3:

  1. Move content from libs folder back to lib because ADT 17 automatically add all jars from libs directory under Android dependencies.
  2. Add dependencies from your lib directory as normal eclipse dependency (the old way before ADT 17). Link JAR files with their source JAR files or Javadoc.
  3. In Project properties -> Java build path -> Order and export check all your added dependencies to be included with project class files.
  4. Select Android Tools > Fix Project Properties"
查看更多
登录 后发表回答