[protobuf] Re: NoClassDefFoundError Android

2012-05-09 Thread Kasper Revsbech
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:
http://stackoverflow.com/questions/1334802/how-can-i-use-external-jars-in-an-android-project
http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android

Best and thanks 
Kasper Revsbech 

Den tirsdag den 8. maj 2012 09.25.37 UTC+2 skrev 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/-/utubWuytGfcJ.
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] Re: NoClassDefFoundError

2011-06-12 Thread Jubei
Just another case of RTFM^^  Thank you very much for the help.

Jubei

ps. Btw isn't it strange to have to use source from a tarball to
compile a compiler (protoc) which one must then use to compile more
source from that same tarball? Is it OS related?

On Jun 11, 1:49 am, Ben Wright compuware...@gmail.com wrote:
 The descriptor.proto is the proto that describes proto files.  This
 supports that Java and C++ reflection language feature and is required
 to be part of the java library.

 descriptor.proto is located at protobuf-2.4.1/src/google/protobuf/
 descriptor.proto (with the C++ code)

 Please see the file included in the 2.4.1 distribution at
 protobuf-2.4.1/java/README.txt for instructions on how to properly
 build / install the java library without maven.

 I've included the relevant section below:

 Installation - Without Maven
 

 If you would rather not install Maven to build the library, you may
 follow these instructions instead.  Note that these instructions skip
 running unit tests.

 1) Build the C++ code, or obtain a binary distribution of protoc.  If
    you install a binary distribution, make sure that it is the same
    version as this package.  If in doubt, run:

      $ protoc --version

    If you built the C++ code without installing, the compiler binary
    should be located in ../src.

 2) Invoke protoc to build DescriptorProtos.java:

      $ protoc --java_out=src/main/java -I../src \
          ../src/google/protobuf/descriptor.proto

 3) Compile the code in src/main/java using whatever means you prefer.

 4) Install the classes wherever you prefer.

-- 
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] Re: NoClassDefFoundError

2011-06-11 Thread Jubei
Just another case of RTFM^^  Thank you very much for the help.

On Jun 11, 1:49 am, Ben Wright compuware...@gmail.com wrote:
 The descriptor.proto is the proto that describes proto files.  This
 supports that Java and C++ reflection language feature and is required
 to be part of the java library.

 descriptor.proto is located at protobuf-2.4.1/src/google/protobuf/
 descriptor.proto (with the C++ code)

 Please see the file included in the 2.4.1 distribution at
 protobuf-2.4.1/java/README.txt for instructions on how to properly
 build / install the java library without maven.

 I've included the relevant section below:

 Installation - Without Maven
 

 If you would rather not install Maven to build the library, you may
 follow these instructions instead.  Note that these instructions skip
 running unit tests.

 1) Build the C++ code, or obtain a binary distribution of protoc.  If
    you install a binary distribution, make sure that it is the same
    version as this package.  If in doubt, run:

      $ protoc --version

    If you built the C++ code without installing, the compiler binary
    should be located in ../src.

 2) Invoke protoc to build DescriptorProtos.java:

      $ protoc --java_out=src/main/java -I../src \
          ../src/google/protobuf/descriptor.proto

 3) Compile the code in src/main/java using whatever means you prefer.

 4) Install the classes wherever you prefer.

-- 
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] Re: NoClassDefFoundError

2011-06-10 Thread Ben Wright
Did you remember to compile descriptor.proto with protoc?

-- 
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] Re: NoClassDefFoundError

2011-06-10 Thread Jubei
Thank you for your response.

Unfortunately I'm not sure what descriptor.proto is. I never had to
compile that before. What would I do with the output of compiling that
file?

On Jun 10, 9:29 am, Ben Wright compuware...@gmail.com wrote:
 Did you remember to compile descriptor.proto with protoc?

-- 
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] Re: NoClassDefFoundError

2011-06-10 Thread Ben Wright
The descriptor.proto is the proto that describes proto files.  This
supports that Java and C++ reflection language feature and is required
to be part of the java library.

descriptor.proto is located at protobuf-2.4.1/src/google/protobuf/
descriptor.proto (with the C++ code)

Please see the file included in the 2.4.1 distribution at
protobuf-2.4.1/java/README.txt for instructions on how to properly
build / install the java library without maven.

I've included the relevant section below:

Installation - Without Maven


If you would rather not install Maven to build the library, you may
follow these instructions instead.  Note that these instructions skip
running unit tests.

1) Build the C++ code, or obtain a binary distribution of protoc.  If
   you install a binary distribution, make sure that it is the same
   version as this package.  If in doubt, run:

 $ protoc --version

   If you built the C++ code without installing, the compiler binary
   should be located in ../src.

2) Invoke protoc to build DescriptorProtos.java:

 $ protoc --java_out=src/main/java -I../src \
 ../src/google/protobuf/descriptor.proto

3) Compile the code in src/main/java using whatever means you prefer.

4) Install the classes wherever you prefer.

-- 
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.