English 中文(简体)
在样本 AndroidApp 中使用解析 SDK 库出错
原标题:Getting Error in using parse SDK library in sample Android App
  • 时间:2012-05-27 13:23:20
  •  标签:
  • android

我正和名为 parse sdk 的第三个政党合作,为Android平台提供一些pi。

我翻阅了这个,"https://www.parse.com/apps/quickstart#android/ existent" rel="nofollow">link ,试图为这个粗糙的板块做一些抽样研究。

但是在那链接上提到的所有螺旋体之后 我无法运行这个测试和机器人应用。

我正在追踪记录中的错误 。

我已经在 libs 文件夹中导入了.jar 文件, 这是我在工程根目录中创建的 。

守则:

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);
    }
}

错误日志 :

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)

编辑 :

根据Choop的评论。

<?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>
问题回答

将下载的 .jar 文件添加到您的 libs 文件夹中。 然后在日食中右键点击 .jar 文件, 并选择 添加到构建路径 。 然后再次运行您的工程。 这将解答它 。

我在同一个问题上花了几个小时,这帮助了这个问题。

后不再将图书馆添加到APK





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签