清单合并失败并出现多个错误,请参阅日志(permission.C2D_MESSAGE)

时间:2017-10-27 19:19:35

标签: android android-studio message android-permissions

我收到此消息:当我尝试运行应用

  

属性值无效   permission#com.techniman.puzzle.permission.C2D_MESSAGE@protectionLevel   在AndroidManifest.xml:27:9-62,value =(signature | signatureOrSystem),   可接受的值是(正常,危险,签名,签名或系统)

请帮助。这是我的清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.techniman.puzzle"
    android:platformBuildVersionCode="26"
    android:platformBuildVersionName="1.0"
    android:versionCode="1"
    android:versionName="1.0">

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <meta-data
        android:name="android.support.VERSION"
        android:value="25.3.1" />

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <permission
        android:name="com.techniman.puzzle.permission.C2D_MESSAGE"
        android:protectionLevel="signature|signatureOrSystem" />
    <uses-permission android:name="com.techniman.puzzle.permission.C2D_MESSAGE" />
    <application
        android:name="com.techniman.puzzle.data.ThisApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Black.NoTitleBar">
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <activity
            android:name="com.techniman.puzzle.activities.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>
        <activity
            android:name="com.techniman.puzzle.activities.TheGame"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.techniman.puzzle.activities.EarnCoinActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.techniman.puzzle.activities.LevelGroupActivity"
            android:screenOrientation="portrait" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />

        <service android:name="com.techniman.puzzle.firebase.MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service android:name="com.techniman.puzzle.firebase.MyFirebaseInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

        <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider172512543220023"
            android:exported="true" />

        <activity
            android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
            android:theme="@style/Theme.IAPTheme" />
        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <service
            android:name="com.google.firebase.messaging.FirebaseMessagingService"
            android:exported="true">
            <intent-filter android:priority="-500">
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            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.techniman.kalima" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
            android:exported="false" />

        <service
            android:name="com.google.firebase.iid.FirebaseInstanceIdService"
            android:exported="true">
            <intent-filter android:priority="-500">
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="com.techniman.puzzle.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100" />

        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true"
            android:exported="false" />
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:permission="android.permission.INSTALL_PACKAGES">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize"
            android:theme="@style/com_facebook_activity_theme" />
        <activity android:name="com.facebook.CustomTabMainActivity" />

        <provider
            android:name="com.facebook.internal.FacebookInitProvider"
            android:authorities="com.techniman.puzzle.FacebookInitProvider"
            android:exported="false" />
    </application>
</manifest>

这是我的傻瓜:

    apply plugin: 'com.android.application'

android {
    signingConfigs {
        mykey {
            keyAlias 'monther'
            keyPassword '123400'
            storeFile file('E:/android keys/kalima.jks')
            storePassword '123400'
        }
    }
    compileSdkVersion 23
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId "com.techniman.puzzle"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        signingConfig signingConfigs.mykey
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            signingConfig signingConfigs.mykey
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }
    productFlavors {
    }
}




dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.parse.bolts:bolts-android:1.1.3'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.facebook.android:facebook-android-sdk:4.5.0'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.firebase:firebase-messaging:9.0.2'
}

我该如何解决呢。

0 个答案:

没有答案