3

Here i am doing something with 3rd party sdk named parse sdk which provides some api for Android Platform.

I gone through this link and try to do some sample work out for this parse sdk.

But After did all the stpes which mentioned on that link i am not able to run this test android application.

I am getting following error in logcat.

I already imported .jar file in libs folder which i made in root directory of project.

Code:

package com.parse.starter;

import com.parse.Parse;
import com.parse.ParseObject;

import android.app.Activity;
import android.os.Bundle;

public class ParseStarterProjectActivity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Parse.initialize(this, "ZVhSPsDKds8cerZ2jjDNXCpu332RHtix6Gp7YkDa", "poQXYifVzMd6haf56U5FQ13xeCxecdGippZeCMyVO");
         ParseObject testObject = new ParseObject("TestObject");

         testObject.put("foo", "bar");
         testObject.saveInBackground();
        setContentView(R.layout.main);
    }
}

Error Log :

05-27 17:16:47.200: W/dalvikvm(468): threadid=1: thread exiting with uncaught exception (group=0x40015560)
05-27 17:16:47.210: E/AndroidRuntime(468): FATAL EXCEPTION: main
05-27 17:16:47.210: E/AndroidRuntime(468): java.lang.NoClassDefFoundError: com.parse.ParseObject
05-27 17:16:47.210: E/AndroidRuntime(468):  at com.parse.starter.ParseStarterProjectActivity.onCreate(ParseStarterProjectActivity.java:14)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.os.Looper.loop(Looper.java:123)
05-27 17:16:47.210: E/AndroidRuntime(468):  at android.app.ActivityThread.main(ActivityThread.java:3683)
05-27 17:16:47.210: E/AndroidRuntime(468):  at java.lang.reflect.Method.invokeNative(Native Method)
05-27 17:16:47.210: E/AndroidRuntime(468):  at java.lang.reflect.Method.invoke(Method.java:507)
05-27 17:16:47.210: E/AndroidRuntime(468):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-27 17:16:47.210: E/AndroidRuntime(468):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-27 17:16:47.210: E/AndroidRuntime(468):  at dalvik.system.NativeStart.main(Native Method)

Edit :

As per choop comment.

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="gen"/>
    <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
    <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
    <classpathentry kind="lib" path="libs/Parse-1.0.19.jar"/>
    <classpathentry kind="output" path="bin/classes"/>
</classpath>
user1089679
  • 2,328
  • 8
  • 41
  • 51

2 Answers2

7

Add the downloaded .jar file to your libs folder. Then in eclipse, right click on the .jar file and select "add to build path". Then run your project again. This should solve it.

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
1

I spent a few hours on the same issue and this helped the issue.

Libraries do not get added to APK anymore after upgrade to ADT 22

Community
  • 1
  • 1
droidment
  • 555
  • 5
  • 7