找不到类路径上的异常GCMIntentServices DexPathList [英] class not found exception GCMIntentServices on path DexPathList

查看:268
本文介绍了找不到类路径上的异常GCMIntentServices DexPathList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我检查了大部分可用的材料对GcmIntentServices但无法弄清楚我面临的问题。

i have checked most of the available material on GcmIntentServices but couldn't figure out the problem i am facing..

推送通知code提供的登录页和下一页是主屏幕,但发生的意图没有失败..但之后在主页上一段时间。该应用程序崩溃。

The Push notification code is provided on the login page and the next page is homeScreen, but the intent occurs without fail.. yet after some time on the home page.. the app crashes..

我的日志猫提供了以下错误。

my log cat provides the following error..

 E/AndroidRuntime(1449): FATAL EXCEPTION: main
 E/AndroidRuntime(1449): Process: com.example.smss, PID: 1449
 E/AndroidRuntime(1449): java.lang.RuntimeException: Unable to instantiate service
  com.example.smss.GCMIntentService: java.lang.ClassNotFoundException: 
 Didn't find class "com.example.smss.GCMIntentService" on path:
  DexPathList[[zip file "/data/app/com.example.smss-1.apk"],
 nativeLibraryDirectories=[/data/app-lib/com.example.smss-2, /vendor/lib, /system/lib]]

 E/AndroidRuntime(1449):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2556)
 E/AndroidRuntime(1449):    at android.app.ActivityThread.access$1800(ActivityThread.java:135)
 E/AndroidRuntime(1449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
 E/AndroidRuntime(1449):    at android.os.Handler.dispatchMessage(Handler.java:102)
 E/AndroidRuntime(1449):    at android.os.Looper.loop(Looper.java:136)
 E/AndroidRuntime(1449):    at android.app.ActivityThread.main(ActivityThread.java:5017)
 E/AndroidRuntime(1449):    at java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(1449):    at java.lang.reflect.Method.invoke(Method.java:515)
 E/AndroidRuntime(1449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/AndroidRuntime(1449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/AndroidRuntime(1449):    at dalvik.system.NativeStart.main(Native Method)
 E/AndroidRuntime(1449): Caused by: java.lang.ClassNotFoundException:
  Didn't find class "com.example.smss.GCMIntentService" on path:
  DexPathList[[zip file "/data/app/com.example.smss-1.apk"],
 nativeLibraryDirectories=[/data/app-lib/com.example.smss-2, /vendor/lib, /system/lib]]

 E/AndroidRuntime(1449):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 E/AndroidRuntime(1449):    at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
 E/AndroidRuntime(1449):    at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
 E/AndroidRuntime(1449):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2553)
 E/AndroidRuntime(1449):    ... 10 more

这是为什么发生的历史?

why is this occuring??

这是我的清单。

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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="18" />
<!-- GCM connects to Internet Services. -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!-- Creates a custom permission so only this app can receive its messages. -->
<permission
    android:name="com.example.smss.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

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

<!-- This app has permission to register and receive data message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<!-- Network State Permissions to detect Internet status -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Permission to vibrate -->
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.smss.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!-- Register Activity -->
    <activity
        android:name="com.quinoid.sms.pushnotifications.RegisterActivity"
        android:label="@string/app_name" >
    </activity>

    <!-- Main Activity -->
    <activity
        android:name="com.quinoid.sms.pushnotifications.InitialActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/app_name" >
    </activity>
    <activity android:name="com.example.smss.homepage"></activity>



     <receiver
        android:name="com.google.android.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>

            <!-- Receives the actual messages. -->
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <!-- Receives the registration id. -->
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.androidhive.pushnotifications" />
        </intent-filter>
    </receiver>

    <service android:name=".GCMIntentService" />
</application>

推荐答案

确定你需要修复的清单使用PACKAGENAME:

ok you need to fix the PackageName in the Manifest use:

<service android:name="com.quinoid.sms.pushnotifications.GCMIntentService" />

这篇关于找不到类路径上的异常GCMIntentServices DexPathList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆