parse.com eclipse android 出错

error with parse.com eclipse android

我有一个应用程序使用来自通知推送的 parse.com,但是当我启动它时出现错误。我已将 parse.jar 导入我的项目

清单:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.images"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="18" />

     <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission android:protectionLevel="signature"
        android:name="com.example.images.permission.C2D_MESSAGE" />

    <uses-permission 
    android:name="com.example.images.permission.C2D_MESSAGE" />

    <application
            android:name="com.example.images.PushSenseiApplication"
          android:allowBackup="true"
        android:icon="@drawable/ico2"
        android:label="@string/app_name"
        android:theme="@style/AppBaseTheme">

        <activity
            android:name="com.example.images.MainActivity"
            android:label="@string/app_name">

        </activity>
        <activity
            android:name="com.example.images.logi"
            android:label="@string/app_name">
             <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.images.puntosClass"
            android:label="@string/app_name">

        </activity>

        <activity
            android:name="com.example.images.onceClass"
            android:label="@string/app_name">

        </activity>
        <activity
            android:name="com.example.images.webviewClass"
            android:label="@string/app_name">

        </activity>
        <activity
            android:name="com.example.images.lesionClass"
            android:label="@string/app_name">

        </activity>

        <service android:name="com.parse.PushService" />
        <receiver android:name="com.parse.ParseBroadcastReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.USER_PRESENT" />
            </intent-filter>
        </receiver>
        <receiver android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <!--
                  IMPORTANT: If you change the package name of this sample app,
                  change "com.parse.tutorials.pushnotifications" in the lines
                  below to match the new package name.
                -->
                <category android:name="com.example.images" />
            </intent-filter>
        </receiver>

    </application>

</manifest>

类扩展应用程序:

package com.example.images;

import android.app.Application;

import com.parse.Parse;
import com.parse.ParseInstallation;

public class PushSenseiApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Parse.initialize(this, "WGauUt9cYuayGY9oGmMJ5tfS7xND2RQFk1zREDO1",
                "2jIL3urydrUBUPqM7sEGzvkrBXIO0srPwgaz7NrA");
    ParseInstallation.getCurrentInstallation()
        .saveInBackground();
    }
}

错误日志(有点)

01-08 14:21:33.360: E/dalvikvm(5811): Could not find class 'com.parse.ParseRequest', referenced from method com.parse.ParseRequest.executeAsync
01-08 14:21:33.384: E/dalvikvm(5811): Could not find class 'bolts.Task$TaskCompletionSource', referenced from method com.parse.ParseRequest.sendOneRequestAsync
01-08 14:21:33.396: E/dalvikvm(5811): Could not find class 'bolts.Task$TaskCompletionSource', referenced from method com.parse.ParseRequest.cancel
01-08 14:21:33.428: E/dalvikvm(5811): Could not find class 'bolts.Capture', referenced from method com.parse.ParseObject.canBeSerialized
01-08 14:21:33.428: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.enqueueSaveEventuallyOperationAsync
01-08 14:21:33.428: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.fetchAllAsync
01-08 14:21:33.440: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.fetchAllIfNeededAsync
01-08 14:21:33.440: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.fetchAllIfNeededInBackground
01-08 14:21:33.444: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.fetchAllInBackground
01-08 14:21:33.488: E/dalvikvm(5811): Could not find class 'com.parse.ParseObject', referenced from method com.parse.ParseObject.deleteEventually

我想你忘了添加一个接收器,将这个接收器添加到你的清单中

<receiver android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
  <intent-filter>
    <action android:name="com.parse.push.intent.RECEIVE" />
    <action android:name="com.parse.push.intent.DELETE" />
    <action android:name="com.parse.push.intent.OPEN" />
    </intent-filter>
</receiver>

如果您还没有添加这些权限,您还需要添加这些权限

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />


<permission android:protectionLevel="signature"
android:name="com.example.images.permission.C2D_MESSAGE" />
<uses-permission android:name="com.example.images.permission.C2D_MESSAGE" />

有关更多详细信息,您可以查看:https://www.parse.com/apps/quickstart#parse_push/android/new