1

I am developing an Android native extension for push notification. I have added the gcm library to the class path but the class GoogleCloudMessaging could not be found. Even thought the jar from google is added to the class path of the android project, I still get the error message, so after I export the jar I am updating with the classes from the Google gcm jar. After this everything looks ok at jar level but the problem still persist and I have the following error:

 W/dalvikvm(10513): VFY: unable to resolve static method 2592: Lcom/google/android/gms/gcm/GoogleCloudMessaging;.getInstance (Landroid/content/Context;)Lcom/google/android/gms/gcm/GoogleCloudMessaging;
08-17 19:32:10.328: W/dalvikvm(10513): threadid=16: thread exiting with uncaught exception (group=0x40adb9f0)
08-17 19:32:10.348: E/AndroidRuntime(10513): FATAL EXCEPTION: AsyncTask #1
08-17 19:32:10.348: E/AndroidRuntime(10513): java.lang.RuntimeException: An error occured while executing doInBackground()
08-17 19:32:10.348: E/AndroidRuntime(10513):    at android.os.AsyncTask$3.done(AsyncTask.java:278)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.lang.Thread.run(Thread.java:856)
08-17 19:32:10.348: E/AndroidRuntime(10513): Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging
08-17 19:32:10.348: E/AndroidRuntime(10513):    at com.microsoft.windowsazure.notifications.NotificationsManager$1.doInBackground(NotificationsManager.java:43)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at com.microsoft.windowsazure.notifications.NotificationsManager$1.doInBackground(NotificationsManager.java:1)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
08-17 19:32:10.348: E/AndroidRuntime(10513):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-17 19:32:10.348: E/AndroidRuntime(10513):    ... 5 more
Brian
  • 3,850
  • 3
  • 21
  • 37
AlexGo
  • 487
  • 4
  • 19
  • Are you following the steps from http://stackoverflow.com/questions/7732742/air-3-native-extensions-for-android-can-i-how-to-include-3rd-party-libraries ? – Brian Aug 19 '14 at 16:11
  • yes. I did followed all the steps I made a lot of combinations...it is incredible – AlexGo Aug 19 '14 at 22:15
  • Could you post your build script for the ANE and the command you're using to update your `jar` file with dependencies? – Brian Aug 19 '14 at 22:20
  • The command is jar -uf external.jar com (the package). Then I put the updated jar into a directory with the library.swc and with the libray project and then I use the adt tool to generate the ANE. – AlexGo Aug 20 '14 at 13:01

0 Answers0