0

I have multiple projects, an Android project and a couple of "Java Library" projects that I need to import into my main Android project.

My library uses springFramework.jar, when I include this library into my Android I get the following exception.

10-01 11:35:04.101: E/dalvikvm(1144): Could not find class 'org.springframework.web.client.RestTemplate', referenced from method com.nuvasive.shared.atlasmobile.service.ServiceClient.

If I include the jar files into my main project as well as the library everything works fine, but I rather not do that.

So there are two problems here:

  • Seems like jar file in my library is not being added to my main project
  • My main project can't access classes in my library project

What am I doing wrong here?

enter image description here

enter image description here

4

2 回答 2

1

According to me if you have added jar files to build path(check in libraries tab) then remove them from that tab and as i can see you have not marked jars you are using in order and export please nark all jars you are using. You will see those under private libraries in libraries tab.

Try it.

于 2013-10-01T16:43:21.507 回答
0

I'm not entirely sure what you're trying do without knowing what 'springFramework.jar' is, what libraries you have linked in all your projects, what your code is doing, etc., but my guess is that this is some kind of dependency issue.

Check out http://mvnrepository.com/search.html?query=spring+framework+. Although this site is designed for maven dependencies, I believe you can download any of the jars directly.

'springframework.jar' is probably an older build of Spring that combined multiple components that are now broken up into different modules (spring-core, spring-jdbc, spring-web, etc.) Perhaps your main project has another needed dependency that your Android project does not?

于 2013-10-01T16:36:48.297 回答