无法使用GCM进行推送,因为即使所有必需的权限都在清单

时间:2016-11-23 03:26:43

标签: parsing

您好我已经遇到这个问题我一直在部署我的应用程序,但我一直收到此错误

11-23 11:25:23.381 18936-18987 / nandos.android.appmy E / com.parse.PushService:尝试使用推送,但此应用未配置为推送,原因是:没有为此配置推送应用程序,因为应用程序清单缺少必需的声明。请将以下声明添加到您的应用清单中,以支持推送(或两者)的GCM或PPNS。要启用GCM支持,请确保将这些权限声明为根元素的子级:

                                                                         <uses-permission android:name="android.permission.INTERNET" />
                                                                         <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                                                                         <uses-permission android:name="android.permission.VIBRATE" />
                                                                         <uses-permission android:name="android.permission.WAKE_LOCK" />
                                                                         <uses-permission android:name="android.permission.GET_ACCOUNTS" />
                                                                         <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
                                                                         <permission android:name="nandos.android.appmy.permission.C2D_MESSAGE" android:protectionLevel="signature" />
                                                                         <uses-permission android:name="nandos.android.appmy.permission.C2D_MESSAGE" />

                                                                         Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:

                                                                         <service android:name="com.parse.PushService" />
                                                                         <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" />
                                                                             <category android:name="nandos.android.appmy" />
                                                                           </intent-filter>
                                                                         </receiver>
                                                                         To enable PPNS support, please make sure that these permissions are declared as children of the root <manifest> element:

                                                                         <uses-permission android:name="android.permission.INTERNET" />
                                                                         <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                                                                         <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
                                                                         <uses-permission android:name="android.permission.VIBRATE" />
                                                                         <uses-permission android:name="android.permission.WAKE_LOCK" />

                                                                         Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:

                                                                         <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>

1 个答案:

答案 0 :(得分:0)

这是我的清单:

enter code here <?xml version="1.0" encoding="utf-8"?>

<permission
    android:name="nandos.android.appmy.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<!--Required permission for JPush-->
<permission
    android:name="nandos.android.appmy.permission.JPUSH_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="nandos.android.appmy.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<!-- Optional. Required for location feature -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<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.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<!--Required permission for JPush-->


<uses-permission android:name="nandos.android.appmy.permission.MAPS_RECEIVE" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />

<uses-feature android:name="android.hardware.camera" />

<uses-permission android:name="android.permission.CALL_PHONE" />

<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:name="nandos.android.appmy.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="nandos.android.appmy.permission.C2D_MESSAGE" />

<application
    android:name="nandos.android.appmy.ui.activities.NandoApplication"
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/Theme.Nandos_actionbar">
    <uses-library
        android:name="com.google.android.maps"
        android:required="true" />



    <!--Release Key -->
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyBfGUWQYewQ2grdwckW0cyYUyGy7-qHugw" />
    <!--AIzaSyBfGUWQYewQ2grdwckW0cyYUyGy7-qHugw-->
    <!--AIzaSyBtOtmmPuaXb_B2PfBvvRUOapBTnO7w4k4   testing-->
    <activity
        android:name="nandos.android.lib.ui.activities.contact.ContactActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="nandos.android.appmy.ui.activities.OverrideMainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>

            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>
        <intent-filter>

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="myapp"
                android:scheme="nando"
                />
        </intent-filter>
    </activity>
    <activity
        android:name=".ui.activities.menu.OverrideMenuActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="nandos.android.appmy.ui.activities.NewContactUsActivity_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name="nandos.android.appmy.ui.activities.tabletalk.TableTalkerMainActivity_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name="nandos.android.appmy.ui.activities.OverrideRestaurantsActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".ui.activities.LoyaltyActivity_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".ui.activities.socialhub.SocialHubActivity_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".ui.activities.socialhub.SocialHubDetails_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <!--JPush Requirements-->
    <activity
        android:name="cn.jpush.android.ui.PopWinActivity"
        android:theme="@style/MyDialogStyle"
        android:exported="false">
    </activity>
    <!-- Required SDK Core functions-->
    <activity
        android:name="cn.jpush.android.ui.PushActivity"
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.NoTitleBar"
        android:exported="false">
        <intent-filter>
            <action android:name="cn.jpush.android.ui.PushActivity" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="nandos.android.appmy" />
        </intent-filter>
    </activity>
    <!-- Required  SDK Core functions-->
    <service
        android:name="cn.jpush.android.service.DownloadService"
        android:enabled="true"
        android:exported="false" >
    </service>


    <!-- Required SDK Core functions-->
    <!-- Configurable android:process Parameter PushService In other processes -->
    <service
        android:name="cn.jpush.android.service.PushService"
        android:enabled="true"
        android:exported="false">
        <intent-filter>
            <action android:name="cn.jpush.android.intent.REGISTER" />
            <action android:name="cn.jpush.android.intent.REPORT" />
            <action android:name="cn.jpush.android.intent.PushService" />
            <action android:name="cn.jpush.android.intent.PUSH_TIME" />
        </intent-filter>
    </service>

    <!-- since 1.8.0 option Optional. For the same equipment in different applications JPush Services to each other pull function. -->
    <!-- If this feature is enabled to remove the component will not pull up other applications other applications can not be pulled -->
    <service
        android:name="cn.jpush.android.service.DaemonService"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="cn.jpush.android.intent.DaemonService" />
            <category android:name="nandos.android.appmy" />
        </intent-filter>

    </service>

    <!-- Required SDK Core functions-->
    <receiver
        android:name="cn.jpush.android.service.PushReceiver"
        android:enabled="true"
        android:exported="false">
        <intent-filter android:priority="1000">
            <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />   <!--Required  显示通知栏 -->
            <category android:name="nandos.android.appmy" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.USER_PRESENT" />
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
        </intent-filter>
        <!-- Optional -->
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <action android:name="android.intent.action.PACKAGE_REMOVED" />
            <data android:scheme="package" />
        </intent-filter>

    </receiver>
    <!-- Required SDK Core functions-->
    <receiver android:name="cn.jpush.android.service.AlarmReceiver"
        android:exported="false"
        />
    <!--JPush Requirements-->

    <receiver
        android:name="nandos.android.appmy.ui.activities.pushNotification.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="nandos.android.appmy" />
        </intent-filter>
    </receiver>
    <service android:name="nandos.android.appmy.ui.activities.pushNotification.GCMNotificationIntentService" />

    <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" />

            <category android:name="nandos.android.appmy" />
        </intent-filter>
    </receiver>
    <!-- Used for Google Play Store Campaign Measurement-->
    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
    <receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
        android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <meta-data
        android:name="com.crashlytics.ApiKey"
        android:value="2c2ff6e3c30f2c8d1dc8d90718b5ce4c2d4c96f5" />

    <!--Call the JPush channel and App Key-->
    <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default"/>
    <meta-data android:name="JPUSH_APPKEY" android:value="08e8c5fb8b4c587351bce7f0"/>

</application>

enter code here