2014-02-19 127 views
0

twitter4j.auth.AccessToken沒有發現錯誤你好,我已經twitter4j庫添加在我的項目,但是當我試圖運行我的程序其給予java.lang.NoClassDefFoundError:twitter4j.auth.AccessToken錯誤android系統

String token ="88888888888888888888888888888888"; 
    String secret = "8888888888888888888888"; 
    AccessToken a = new AccessToken(token,secret); 
    Twitter twitter = new TwitterFactory().getInstance(); 
    twitter.setOAuthConsumer("888888888", "88888888888888888888"); 
    twitter.setOAuthAccessToken(a); 
    try { 
     twitter.updateStatus("i ma app"); 
    } catch (TwitterException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

manifest file: 
<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.twitter" 
android:versionCode="1" 
android:versionName="1.0" > 
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> 
<!-- So that we can get the account name --> 
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> 

<!-- Used to request data from the Google+ APIs in the SignInActivity --> 
<uses-permission android:name="android.permission.INTERNET" /> 
<!-- Required if we need to invalidate access tokens --> 
<uses-permission android:name="android.permission.USE_CREDENTIALS"/> 
<application android:allowBackup="true" 
android:icon="@drawable/ic_launcher" 
android:label="@string/app_name" 
android:theme="@style/AppTheme" > 
<activity 
android:name="com.twitter.MainActivity" 
android:label="@string/app_name" > 
<intent-filter> 
<action android:name="android.intent.action.MAIN" /> 

<category android:name="android.intent.category.LAUNCHER" /> 
</intent-filter> 
</activity> 
</application> 

+0

添加最新的'twitter4j library' becoz舊版本不包含'twitter4j.auth.AccessToken classes' –

+0

我發現俺們所有我需要做的就是添加所有的jar到庫文件夾 – DCoder

+1

你是對的,但在這裏你添加了最新的.jar文件。 –

回答