[英]manifest merger failed with multiple errors, see logs”
我刚刚制作了一个用于通知的应用,当我运行它时,它显示
“清单合并失败,出现多个错误,请参阅日志”。
我已经清理并重建了项目。 但是不行。 而且原木猫太大,所以我不能包括它。
Manifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:replace="android:icon"
package="shiweichen22gmail.notification">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="shiweichen22gmail.notification.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="shiweichen22gmail.notification.permission.C2D_MESSAGE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label= "@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:label="@string/app_name" android:theme="@style/AppTheme">
<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="shiweichen22gmail.notification"/>
</intent-filter>>
</receiver>
<service android:name=".GCMPushReceiverService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service android:name=".GCMRegistrationIntentService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
</application>
</manifest>
您只需要在AndroidManifest.xml中添加此行。
<permission
android:name="your_package.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="your_package.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<receiver
android:name="your_package.NotificationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="your_package" />
</intent-filter>
</receiver>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.