0

I´m using the Picasa Api and added the following libraries:

activation.jar
gdata-client-1.0.jar
gdata-client-meta-1.0.jar
gdata-core-1.0.jar
gdata-media-1.0.jar
gdata-photos-2.0.jar
gdata-photos-meta-2.0.jar
mail.jar

Further I´m importing:

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.http.HttpRequestFactory;
import com.google.gdata.client.photos.PicasawebService;
import com.google.gdata.data.photos.AlbumFeed;
import com.google.gdata.data.photos.PhotoEntry;

import com.google.gdata.client.*;
import com.google.gdata.client.photos.*;
import com.google.gdata.data.*;
import com.google.gdata.data.media.*;
import com.google.gdata.data.photos.*;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;

But at onCreate: PicasawebService myPicasa = new PicasawebService("Test"); I get the following error:

java.lang.NoClassDefFoundError: com.google.gdata.client.photos.PicasawebService.

I´ve seen that other people have had the same issue, but I couldn´t find an answer for Android programming in Eclipse. Anybody any tips how to solve this? Why can´t it find the ClassDef?

Thanks

yorkw
  • 40,926
  • 10
  • 117
  • 130
Diego
  • 4,011
  • 10
  • 50
  • 76

2 Answers2

1

try to use this library http://code.google.com/p/gdata-java-client/downloads/list

for PicasawebService

MAC
  • 15,799
  • 8
  • 54
  • 95
  • I already downloaded the zip-file and used these files from that zip: gdata-client-1.0.jar gdata-client-meta-1.0.jar gdata-core-1.0.jar gdata-media-1.0.jar gdata-photos-2.0.jar gdata-photos-meta-2.0.jar, do I need to do more? – Diego Apr 26 '12 at 18:34
1

It seems to me that those jar files are not included in the built APK. You should create a lib folder inside your Android project folder and put the jars there and then reference them from the lib folder in your eclipse build path

Anirudh
  • 2,524
  • 1
  • 14
  • 14
  • I added them in configure buildpath -> Libraries -> Add Jars.. And I can see them now in referenced libraries, that should be it right? Cause it aint working. – Diego Apr 26 '12 at 18:43
  • Ah, I think I understand what you´re saying. Copy them into the lib and then add them to the build path, instead of directly adding them! – Diego Apr 26 '12 at 18:52
  • Also make sure the library is checked on the Order and Export tab on Configure Build Path screen. – Jack Apr 26 '12 at 19:12
  • I think it did it, only thing is now I get the following one: Caused by: java.lang.NoClassDefFoundError: com.google.common.collect.Maps, but I´m gonna search on that one. – Diego Apr 27 '12 at 10:06
  • I found this solution on my last issue: I solved this problem by download the jar file guava-r07.jar. http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r07.zip but it seems to be depreciated and I shouldn´t use it. Anybody know which JAR file I should use? And where I can download this one. – Diego Apr 27 '12 at 10:14