Re: [protobuf] NoClassDefFoundError Android

2012-05-08 Thread 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




Den tirsdag den 8. maj 2012 18.18.21 UTC+2 skrev Jason Hsueh:
>
> 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
>
> On Tue, May 8, 2012 at 12:25 AM, Kasper Revsbech wrote:
>
>> Hi all 
>> I have a mind wrapping problem using protocol Buffers on Android. 
>> I among other commands defined a request in my .proto file:
>> http://pastebin.com/B4htQeRm
>>
>> 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 
>>
>>
>>  -- 
>> 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 protobuf@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> protobuf+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/protobuf?hl=en.
>>
>
>

-- 
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/-/4Yvjb6GxPWsJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] NoClassDefFoundError Android

2012-05-08 Thread Jason Hsueh
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

On Tue, May 8, 2012 at 12:25 AM, Kasper Revsbech wrote:

> Hi all
> I have a mind wrapping problem using protocol Buffers on Android.
> I among other commands defined a request in my .proto file:
> http://pastebin.com/B4htQeRm
>
> 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
>
>
>  --
> 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 protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>

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



[protobuf] NoClassDefFoundError Android

2012-05-08 Thread Kasper Revsbech
Hi all 
I have a mind wrapping problem using protocol Buffers on Android. 
I among other commands defined a request in my .proto file:
http://pastebin.com/B4htQeRm

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 


-- 
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 protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] NoClassDefFoundError

2011-06-10 Thread Jubei
Hello. I have already read the previous posts and attempted to
everything right to get Protobuf 2.4.1 working on android but I still
get a NoClassDefFoundError on runtime at the following line:

PhoneEvent.Builder eventMessage =
PhoneEvent.newBuilder().setX(x).setY(y).setZ(z);

I have:
- Downloaded protobuf-2.4.1.tar.bz2, unpacked it and ./configure,
make, sudo make install. When I run protoc --version I get libprotoc
2.4.1
- used protoc to compile the .proto to java source and also included
that under my source.
- used maven to build the lite .jar (my proto file has "option
optimize_for = LITE_RUNTIME;") --> mvn package -P lite
- put the .jar file under lib, made a new userlibrary and referenced
it in my build path. Project compiles fine.

The funny thing is that the exact same code used to work fine with a
random protobuf.jar I found somewhere on the net and stuffed in my
build path. It's when I tried to move to protobuf 2.4.1 that all
problems started. Am I missing something?

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