1

我已经通过此链接https://github.com/phonegap-build/PushPlugin在我的应用程序中实现了 phonegap pushplugin 。我已经按照所有那些已经给出的安装,但我得到这个错误原因:java.lang.ClassNotFoundException。

下面是我的Androidmanifestfile

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

    <uses-sdk android:minSdkVersion="10" />

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <permission android:name="com.jilmil.arbvantage.permission.C2D_MESSAGE" android:protectionLevel="signature" />
    <uses-permission android:name="com.jilmil.arbvantage.permission.C2D_MESSAGE" />

    <application android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

        <activity android:name="com.plugin.GCM.PushHandlerActivity"/>
        <receiver android:name="com.google.android.gcm.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" />
            <category android:name="com.jilmil.arbvantage" />
          </intent-filter>
        </receiver>
        <service android:name="com.google.android.gcm.GCMIntentService" />

        <activity android:configChanges="orientation|keyboardHidden"
            android:name=".MyPhoneGapActivity"
            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>

</manifest>

日志错误:

04-30 12:08:24.579: E/AndroidRuntime(23143): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.jilmil.arbvantage/com.jilmil.arbvantage.MyPhoneGapActivity}: java.lang.ClassNotFoundException: com.jilmil.arbvantage.MyPhoneGapActivity in loader dalvik.system.PathClassLoader[/data/app/com.jilmil.arbvantage-2.apk]
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.os.Looper.loop(Looper.java:130)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread.main(ActivityThread.java:3687)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at java.lang.reflect.Method.invokeNative(Native Method)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at java.lang.reflect.Method.invoke(Method.java:507)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at dalvik.system.NativeStart.main(Native Method)
04-30 12:08:24.579: E/AndroidRuntime(23143): Caused by: java.lang.ClassNotFoundException: com.jilmil.arbvantage.MyPhoneGapActivity in loader dalvik.system.PathClassLoader[/data/app/com.jilmil.arbvantage-2.apk]
04-30 12:08:24.579: E/AndroidRuntime(23143):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-30 12:08:24.579: E/AndroidRuntime(23143):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)

MyPhoneGapActivity.java

package com.jilmil.arbvantage;

import org.apache.cordova.DroidGap;
import android.os.Bundle;

public class MyPhoneGapActivity extends DroidGap {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}
4

0 回答 0