Android和放大器; Eclipse的错误:找不到类的com.dropbox.client2.session.AppKeyPair“ [英] Android & Eclipse Error: Could not find class 'com.dropbox.client2.session.AppKeyPair'

查看:222
本文介绍了Android和放大器; Eclipse的错误:找不到类的com.dropbox.client2.session.AppKeyPair“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse做一个Android应用程序。我想实现一个功能,分享我的Dropbox帐户的文件,所以我下载了SDK。

I'm making an Android App using Eclipse. I want to implement a feature that shares a file on my dropbox account so I downloaded the sdk.

我在这里以下官方文档: https://www.dropbox.com/开发商/启动/认证#机器人

I'm following official documentation here: https://www.dropbox.com/developers/start/authentication#android

所以我在进口部分写这篇code:

so I wrote this code in Import Section:

import com.dropbox.client2.DropboxAPI;
import com.dropbox.client2.android.AndroidAuthSession;
import com.dropbox.client2.session.AppKeyPair;
import com.dropbox.client2.session.Session.AccessType;

这code在CLASSE声明

This code in classe declaration

final static private String APP_KEY = "*****";
final static private String APP_SECRET = "****";
private DropboxAPI<AndroidAuthSession> mDBApi;

这code在我的方法:

and this code in my method:

com.dropbox.client2.session.AppKeyPair appKeys = new com.dropbox.client2.session.AppKeyPair(APP_KEY, APP_SECRET);
AndroidAuthSession session = new AndroidAuthSession(appKeys,AccessType.APP_FOLDER);
mDBApi = new DropboxAPI<AndroidAuthSession>(session);

但是,当我调试方法的第一行我有这样的错误:

But when I debug first line of method I have this error:

01-02 17:07:54.459: E/dalvikvm(19602): Could not find class 'com.dropbox.client2.session.AppKeyPair', referenced from method com.example.myfirstapp.DbAccess.ShareDbOnDropbox

请,你能帮帮我吗?

非常感谢你!

推荐答案

在添加的.jar 文件到你的项目,你的导出JAR

When adding the .jar file to your project, do you export the jar on the build path?

右键点击您的项目在Eclipse中,选择属性,然后选择 Java构建路径。导航到订单和出口选项卡,并确保在 Dropbox的库被选中

Right click your project in Eclipse, select Properties, then select Java Build Path. Navigate to the Order and Export tab and make sure that the Dropbox library is ticked.

这出口类在项目中使用,当应用程序被编译并建造的。

This exports the classes for use in your project when the application is compiled and built.

点击确定,然后做一个干净的构建,然后再试一次。

Click Ok, then do a clean build and try again.

这篇关于Android和放大器; Eclipse的错误:找不到类的com.dropbox.client2.session.AppKeyPair“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆