Re: Gradle java.lang.NoClassDefFoundError

449 views
Skip to first unread message

Xavier Ducrohet

unread,
May 1, 2013, 6:43:52 PM5/1/13
to adt...@googlegroups.com
What code is throwing the exception? Code in your main app or in your test app?


On Wed, May 1, 2013 at 2:09 PM, Ethan Hall <et...@ehdev.io> wrote:
Hi,

I am using the Android plugin (0.3) and it looks like the dependencies aren't being included in the testing apk. 

When running the test ( ./gradlew clean deviceCheck ) I get a 
    java.lang.NoClassDefFoundError: org.jeromq.ZMQ$Socket

I looked at the dex file that gets created and the org.jeromq package doesn't exist.

When running the dependencies task I get this ( empty blocks omitted ):

compile - Classpath for compiling the main sources.
\--- org.jeromq:jeromq:0.2.0

default - Configuration for default artifacts.
\--- org.jeromq:jeromq:0.2.0

instrumentTestCompile - Classpath for compiling the instrumentTest sources.
+--- org.mockito:mockito-core:1.9.5
|    +--- org.hamcrest:hamcrest-core:1.1
|    \--- org.objenesis:objenesis:1.0
\--- com.google.dexmaker:dexmaker-mockito:1.0
     +--- com.google.dexmaker:dexmaker:1.0
     \--- org.mockito:mockito-core:1.9.5 (*)

instrumentTestPackage - Classpath packaged with the compiled instrumentTest classes.
+--- org.mockito:mockito-core:1.9.5
|    +--- org.hamcrest:hamcrest-core:1.1
|    \--- org.objenesis:objenesis:1.0
\--- com.google.dexmaker:dexmaker-mockito:1.0
     +--- com.google.dexmaker:dexmaker:1.0
     \--- org.mockito:mockito-core:1.9.5 (*)

package - Classpath packaged with the compiled main classes.
\--- org.jeromq:jeromq:0.2.0

Any thought are appreciated.

Thanks,
Ethan

--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Ethan Hall

unread,
May 1, 2013, 9:50:40 PM5/1/13
to adt...@googlegroups.com
My code it throwing the exception. When I call 
zmqSocket = mock(ZMQ.Socket.class);
When I decompile the dex file in the testing APK the class(ZMQ.Socket) isn't there. I can attach the sample project if that would help.

Xavier Ducrohet

unread,
May 1, 2013, 11:31:32 PM5/1/13
to adt...@googlegroups.com
The test app should have access to all the classes from the tested app. I'll double check with our test framework team to see if I'm missing something.

Ethan Hall

unread,
May 2, 2013, 12:14:55 PM5/2/13
to adt...@googlegroups.com
Awesome thanks. It looks like when building the app, the dependency wasn't included into the test app. Let me know if you need any thing on my end.
Reply all
Reply to author
Forward
0 new messages