'Lcom / google / android / gms / gcm / GcmReceiver'的链接失败 [英] Link of class 'Lcom/google/android/gms/gcm/GcmReceiver;' failed

查看:336
本文介绍了'Lcom / google / android / gms / gcm / GcmReceiver'的链接失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题上已经有两天了

it's been two days that I'm on this Issue

我试图将GCM集成到eclipse环境中的android应用程序上。
一切都像一个魅力,但一旦我收到推送通知消息我有

I'm trying to integrate GCM on an android app on eclipse environment. Everything works like a charm but once I have to receive the push notification message I have


03-07 12:19: 43.725:W / dalvikvm(4364):无法解析超级类
Lcom / google / android / gms / gcm / GcmReceiver; (331)03-07 12:19:43.725:
W / dalvikvm(4364):class
'Lcom / google / android / gms / gcm / GcmReceiver;'失败03-07 12: 19:43.730:
D / AndroidRuntime(4364):关闭VM 03-07 12:19:43.730:
W / dalvikvm(4364):threadid = 1:线程退出未捕获的异常
(group = 0x411c42a0)03-07 12:19:43.825:E / AndroidRuntime(4364):FATAL
EXCEPTION:main 03-07 12:19:43.825:E / AndroidRuntime(4364):
java.lang.RuntimeException:无法实例化接收方
com.google.android.gms.gcm.GcmReceiver:
java.lang.ClassNotFoundException:
com.google.android.gms.gcm。 GcmReceiver

03-07 12:19:43.725: W/dalvikvm(4364): Unable to resolve superclass of Lcom/google/android/gms/gcm/GcmReceiver; (331) 03-07 12:19:43.725: W/dalvikvm(4364): Link of class 'Lcom/google/android/gms/gcm/GcmReceiver;' failed 03-07 12:19:43.730: D/AndroidRuntime(4364): Shutting down VM 03-07 12:19:43.730: W/dalvikvm(4364): threadid=1: thread exiting with uncaught exception (group=0x411c42a0) 03-07 12:19:43.825: E/AndroidRuntime(4364): FATAL EXCEPTION: main 03-07 12:19:43.825: E/AndroidRuntime(4364): java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.gcm.GcmReceiver: java.lang.ClassNotFoundException: com.google.android.gms.gcm.GcmReceiver

我的Google Play Lib已整合,效果非常好,我的收件人已经在清单中声明

My Google play Lib is integrated and works great, my receiver is already declared in the manifest

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

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <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_ACCOUNTS" />

    <application
        android:name="com.media.dailydeals.App"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <activity
            android:name="com.media.dailydeals.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>

        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <category android:name="com.media.dailydeals"/>
            </intent-filter>
        </receiver>
        <service
            android:name="com.media.dailydeals.GcmBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>
        <activity
            android:name="com.facebook.LoginActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
   <meta-data
            android:name="com.google.android.gms.analytics.globalConfigResource"
            android:resource="@xml/global_tracker" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <receiver
            android:name="com.google.android.gms.analytics.AnalyticsReceiver"
            android:enabled="true" >
            <intent-filter>
                <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
            </intent-filter>
        </receiver>
        <service
            android:name="com.google.android.gms.analytics.AnalyticsService"
            android:enabled="true"
            android:exported="false" />


    </application>

</manifest>

我的GcmReceiver类在google play库中,所以我不知道如何链接它。

My GcmReceiver class is in the google play library, so I don't get how it can't link it.

我尝试使用Jar lib,我重建,清理了项目,我甚至删除了重新安装的所有工作区。这是我最后一次的拍摄

I tried to do it with the Jar lib, I rebuild, cleaned the project, I even deleted the reinstalled all the workspace. It's kind of my last shot here

任何帮助将不胜感激。

提前感谢。

推荐答案

我只是想在这里想一想,问题是你没有支持-v4库包含在您的项目中(因为 com.google.android.gms.gcm.GcmReceiver 扩展了android.support.v4.content.WakefulBroadcastReceiver),或者您的Eclipse项目配置错误,如这个答案

I'm just going to go on a whim here and guess that the issue is either that you don't have support-v4 library included in your project (since com.google.android.gms.gcm.GcmReceiver extends android.support.v4.content.WakefulBroadcastReceiver) or your Eclipse project is misconfigured as described in this answer.

免责声明,我从来没有使用Eclipse,快速搜索Unable解决超类让我觉得这将是答案。

Disclaimer, I never used Eclipse, a quick googling on "Unable to resolve superclass" made me think this would be the answer.

这篇关于'Lcom / google / android / gms / gcm / GcmReceiver'的链接失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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