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>
6
  • 1
    Where did your new JAR file located in? lib or libs? Commented May 27, 2012 at 13:29
  • 2
    My guess is that you aren't adding the JAR file to your built path correctly. Commented May 27, 2012 at 13:49
  • I already added jar file if i didnt do that then i got problem at compile time. its run time error. my jar file location is E:\workspace\ParseStarterProject\libs i already added this Commented May 27, 2012 at 14:00
  • @Tim problem in this line ParseObject testObject = new ParseObject("TestObject"); Commented May 27, 2012 at 14:00
  • @user1089679 - Can you also add your .classpath file to your question.. Commented May 27, 2012 at 14:10

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.