Search code examples
androidgdatapicasa

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


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


Solution

  • 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