1

I've been trying to use Sendgrid in my android application. It's a project I'm working on with 3 others. The application works just fine on their phones and emulators, but it always seems to crash on my emulator and phone with this error message

05-07 03:15:12.940: W/EGL_emulation(1336): eglSurfaceAttrib not implemented
05-07 03:15:13.510: D/onDestroy(1336): 2014-05-07 03:15:11
05-07 03:15:13.700: D/dalvikvm(1336): GC_CONCURRENT freed 338K, 33% free 3276K/4820K, paused 5ms+4ms, total 65ms
05-07 03:15:13.790: E/dalvikvm(1336): Could not find class 'com.github.sendgrid.SendGrid', referenced from method edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground
05-07 03:15:13.790: W/dalvikvm(1336): VFY: unable to resolve new-instance 744 (Lcom/github/sendgrid/SendGrid;) in Ledu/upenn/capsproject/SurveyActivity$SendEmailWithSendGrid;
05-07 03:15:13.790: D/dalvikvm(1336): VFY: replacing opcode 0x22 at 0x0001
05-07 03:15:13.790: D/dalvikvm(1336): DexOpt: unable to opt direct call 0x1505 at 0x07 in Ledu/upenn/capsproject/SurveyActivity$SendEmailWithSendGrid;.doInBackground
05-07 03:15:13.800: W/dalvikvm(1336): threadid=11: thread exiting with uncaught exception (group=0x40a71930)
05-07 03:15:13.810: E/AndroidRuntime(1336): FATAL EXCEPTION: AsyncTask #1
05-07 03:15:13.810: E/AndroidRuntime(1336): java.lang.RuntimeException: An error occured while executing doInBackground()
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$3.done(AsyncTask.java:299)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.run(FutureTask.java:239)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.lang.Thread.run(Thread.java:856)
05-07 03:15:13.810: E/AndroidRuntime(1336): Caused by: java.lang.NoClassDefFoundError: com.github.sendgrid.SendGrid
05-07 03:15:13.810: E/AndroidRuntime(1336):     at edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground(SurveyActivity.java:368)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at edu.upenn.capsproject.SurveyActivity$SendEmailWithSendGrid.doInBackground(SurveyActivity.java:1)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at android.os.AsyncTask$2.call(AsyncTask.java:287)
05-07 03:15:13.810: E/AndroidRuntime(1336):     at java.util.concurrent.FutureTask.run(FutureTask.java:234)
05-07 03:15:13.810: E/AndroidRuntime(1336):     ... 4 more
05-07 03:15:15.219: W/EGL_emulation(1336): eglSurfaceAttrib not implemented
05-07 03:15:16.289: I/Process(1336): Sending signal. PID: 1336 SIG: 9
05-07 03:15:16.750: E/Trace(1362): error opening trace file: No such file or directory (2)

I have the sendgrid-0.2.0-jar.jar.zip file in the referenced libraries path.

CPride
  • 95
  • 3
  • 11
  • Have look at this [Use external jar in Android](http://stackoverflow.com/questions/1334802/how-can-i-use-external-jars-in-an-android-project) – Ketan Ahir May 07 '14 at 03:38
  • I tried most of those already. Unfortunately the top voted answers did not work. – CPride May 07 '14 at 04:24
  • Possible dulicate- http://stackoverflow.com/questions/2247998/noclassdeffounderror-eclipse-and-android – Hulk May 07 '14 at 11:39

1 Answers1

0

Go to Project/Properties/Java Build Path/Order and Export -- Make sure there's a check in front of Android Dependencies and the support library, if you use it. Mark all checkboxes and Click on Apply and clean the project.

Copied from my answer on this post

Hope this helps.

Community
  • 1
  • 1
Siddharth_Vyas
  • 9,972
  • 10
  • 39
  • 69