0
的Java郎NoClassDefFoundError的COM kinvey Android客戶端生成器kinveyKinvey的NoClassDefFoundError
收到以下錯誤消息 -
02-13 14:30:31.554: E/AndroidRuntime(787): java.lang.NoClassDefFoundError: com.kinvey.android.Client$Builder
我的代碼拋出的錯誤是 -
final Client mKinveyClient = new Client.Builder(this.getApplicationContext()).build();
添加的所有建議Kinvey庫 -
D:\Software\kinvey-2.6.14\libs\google-http-client-1.16.0-rc.jar
D:\Software\kinvey-2.6.14\libs\google-http-client-android-1.16.0-rc.jar
D:\Software\kinvey-2.6.14\libs\google-http-client-gson-1.16.0-rc.jar
D:\Software\kinvey-2.6.14\libs\gson-2.1.jar
D:\Software\kinvey-2.6.14\libs\guava-14.0.1.jar
D:\Software\kinvey-2.6.14\libs\kinvey-android-lib-2.6.14.jar
D:\Software\kinvey-2.6.14\libs\kinvey-java-2.6.14.jar
我的代碼 -
import com.kinvey.android.Client;
import com.kinvey.android.callback.KinveyPingCallback;
公共類MainActivity擴展活動{
protected static final String TAG = "Kinvey Testing ";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Client mKinveyClient = new Client.Builder(this.getApplicationContext()).build();
mKinveyClient.ping(new KinveyPingCallback()
{
public void onFailure(Throwable t) {
Log.e(TAG, "Kinvey Ping Failed", t);
}
public void onSuccess(Boolean b) {
Log.d(TAG, "Kinvey Ping Success");
}
});
}
錯誤我越來越 -
02-14 06:26:02.630: E/AndroidRuntime(2083): Process: com.example.kinveyhw, PID: 2083
02-14 06:26:02.630: E/AndroidRuntime(2083): java.lang.NoClassDefFoundError: com.kinvey.android.Client$Builder
02-14 06:26:02.630: E/AndroidRuntime(2083): at com.example.kinveyhw.MainActivity.onCreate(MainActivity.java:26)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.Activity.performCreate(Activity.java:5243)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.ActivityThread.access$700(ActivityThread.java:135)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.os.Handler.dispatchMessage(Handler.java:102)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.os.Looper.loop(Looper.java:137)
02-14 06:26:02.630: E/AndroidRuntime(2083): at android.app.ActivityThread.main(ActivityThread.java:4998)
02-14 06:26:02.630: E/AndroidRuntime(2083): at java.lang.reflect.Method.invokeNative(Native Method)
02-14 06:26:02.630: E/AndroidRuntime(2083): at java.lang.reflect.Method.invoke(Method.java:515)
02-14 06:26:02.630: E/AndroidRuntime(2083): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
02-14 06:26:02.630: E/AndroidRuntime(2083): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
六月2日至14日:26:02.630:E/AndroidRuntime (2083):at dalvik.system.NativeStart.main(Native Method)
我的kinvey.pro perties文件 -
app.key=kid_ee-WQHov89
app.secret=566ed27ffdc74ae78ada0c3ef031cc95
清單文件 -
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.kinveyhw.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>
Kinvey,機器人,NoClassDefFoundError的,在Kinvey,Clint.Builder()類未發現異常
它沒有找到名爲** Client.Builder任何類**的**包下com.kinvey.android **。所以,仔細看看你的班級名稱和包裝。 –
可能是你的kinvey jar版本有變化。檢查 – Android
我在下面的網址 - http://devcenter.kinvey.com/android/guides/getting-started# ..提到了同樣的過程,我在做。 – Rakesh