0

我正在使用 Picasa Api 并添加了以下库:

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

此外,我正在进口:

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;

但在 onCreate:PicasawebService myPicasa = new PicasawebService("Test");我收到以下错误:

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

我已经看到其他人也有同样的问题,但我在 Eclipse 中找不到 Android 编程的答案。任何人有任何提示如何解决这个问题?为什么找不到 ClassDef?

谢谢

4

2 回答 2

1

尝试使用这个库 http://code.google.com/p/gdata-java-client/downloads/list

为了PicasawebService

于 2012-04-26T18:31:26.043 回答
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

于 2012-04-26T18:35:06.073 回答