Whenever I try to build the GCM Demo Server from the documentation using ant
, I get 17 compilation errors. It seems that some GCM libraries are missing. How can I resolve these issues?
Errors:
Buildfile: build.xml
init:
compile:
[javac] Compiling 7 source files to /root/gcm/samples/gcm-demo-server/build/classes
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:18: package com.google.android.gcm.server does not exist
[javac] import com.google.android.gcm.server.Constants;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:19: package com.google.android.gcm.server does not exist
[javac] import com.google.android.gcm.server.Message;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:20: package com.google.android.gcm.server does not exist
[javac] import com.google.android.gcm.server.MulticastResult;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:21: package com.google.android.gcm.server does not exist
[javac] import com.google.android.gcm.server.Result;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:22: package com.google.android.gcm.server does not exist
[javac] import com.google.android.gcm.server.Sender;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:46: cannot find symbol
[javac] symbol : class Sender
[javac] location: class com.google.android.gcm.demo.server.SendAllMessagesServlet
[javac] private Sender sender;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:59: cannot find symbol
[javac] symbol : class Sender
[javac] location: class com.google.android.gcm.demo.server.SendAllMessagesServlet
[javac] protected Sender newSender(ServletConfig config) {
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:62: cannot find symbol
[javac] symbol : class Sender
[javac] location: class com.google.android.gcm.demo.server.SendAllMessagesServlet
[javac] return new Sender(key);
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:81: cannot find symbol
[javac] symbol : class Message
[javac] location: class com.google.android.gcm.demo.server.SendAllMessagesServlet
[javac] Message message = new Message.Builder().build();
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:81: package Message does not exist
[javac] Message message = new Message.Builder().build();
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:82: cannot find symbol
[javac] symbol : class Result
[javac] location: class com.google.android.gcm.demo.server.SendAllMessagesServlet
[javac] Result result = sender.send(message, registrationId, 5);
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:115: cannot find symbol
[javac] symbol: class Message
[javac] Message message = new Message.Builder().build();
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:115: package Message does not exist
[javac] Message message = new Message.Builder().build();
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:116: cannot find symbol
[javac] symbol: class MulticastResult
[javac] MulticastResult multicastResult;
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:123: cannot find symbol
[javac] symbol: class Result
[javac] List<Result> results = multicastResult.getResults();
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:127: cannot find symbol
[javac] symbol: class Result
[javac] Result result = results.get(i);
[javac] ^
[javac] /root/gcm/samples/gcm-demo-server/src/com/google/android/gcm/demo/server/SendAllMessagesServlet.java:140: cannot find symbol
[javac] symbol: variable Constants
[javac] if (error.equals(Constants.ERROR_NOT_REGISTERED)) {
[javac] ^
[javac] 17 errors
BUILD FAILED
I've never run this project myself, but it looks like it is missing the libraries from extras\google\gcm\gcm-server\dist\gcm-server.jar and its dependencies. Add these to the libs folder under this project and try again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With