NoClassDefFoundError Android

418 views
Skip to first unread message

Kasper Revsbech

unread,
May 8, 2012, 3:25:37 AM5/8/12
to prot...@googlegroups.com
Hi all 
I have a mind wrapping problem using protocol Buffers on Android. 
I among other commands defined a request in my .proto file:

In my communication I do as follows:

Protocol.request.Builder r = Protocol.request.newBuilder();

However on run time I get the error: 
java.lang.NoClassDefFoundError dk.revsbech.client.Protocol$request

I have now trie with at bunch of jar files both pre compiled and manually compiled both with and withouut Maven, both with and without the LITE_RUNTIME optimization.
However I keep getting the runtime error. 

Tanks in advance 


Jason Hsueh

unread,
May 8, 2012, 12:18:21 PM5/8/12
to Kasper Revsbech, prot...@googlegroups.com
Your proto file in the link looks incomplete. Have you checked the outer class name option? https://developers.google.com/protocol-buffers/docs/reference/java-generated#invocation



--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/MAzfYhJy8PMJ.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

Kasper Revsbech

unread,
May 9, 2012, 2:50:52 AM5/9/12
to prot...@googlegroups.com, Kasper Revsbech
Hi Jason thanks for your answer. I just pasted the relevant lines from the proto file, sorry for not being more explicit about that. 
Here is a paste of the whole file: 
http://pastebin.com/uCKCsviG

the file is called doorProtocol and hence since I have/had not specified the outer class name the java file is named DoorProtocol which for me is fine. It is also placed in the right package, no problems. The problem is that the $request class is not available at runtime. 

Best 
Kasper

To unsubscribe from this group, send email to protobuf+unsubscribe@googlegroups.com.

Kasper Revsbech

unread,
May 9, 2012, 3:27:25 AM5/9/12
to prot...@googlegroups.com
SOLVED!
The problem was not a protocol buffers problem, however a more general problem in ADT after updating. The jars was not copied to the device. For people experincing the same, have a look at:

Best and thanks 
Kasper Revsbech 
Reply all
Reply to author
Forward
0 new messages