What the docs suggest, and what I have had success with, is to have three total projects:
-- The library project -- Some app based on the library project (e.g., demo/) -- The test project set to "test" the app, not the library (e.g., tests/) Obviously, you do not need to write test cases for the sample app itself if you do not want to. But an Android test project cannot directly test an Android library project, as the thing-being-tested needs to result in an APK, and an Android library project does not. On Mon, May 23, 2011 at 5:39 AM, Tancho <[email protected]> wrote: > Hello, > I seem to have a problem with defining a test for a service I am > developing > the Project where the service is located has a project dependency > towards a Commons project which is an Android Library. > the code is running fine when running as an android app > however when running tests the tests fail stating > BackendTest] Test run failed: java.lang.NoClassDefFoundError > which fails because it cannot resolve a class located in the commons > eclipse has no problems resolving the class however all my tests fail > due to unresolved dependencies > the commons project is included both in the backend project and the > test project > however this did not bring to any results.. > any ideas? > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

