Android FCM通知:SecurityException:不允许启动服务意图
我正在尝试使用Xamarin.Android应用程序测试FCM在不同类型的通信中的使用,并且我已经能够设置好所有内容,但是当我尝试为我的Visual Studio Emulator-Android(棉花糖)获取注册令牌时,我遇到了这个错误 java.lang.SecurityException:不允许启动服务意图{ act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (有多余的)}未经允许 com.google.android.c2dm.permission.RECEIVE 04-12 11:43:44.679 E/FirebaseInstanceId(1793年): 这是我的Android.manifest-obj\debug的完整内容Android FCM通知:SecurityException:不允许启动服务意图,android,firebase,xamarin,firebase-cloud-messaging,Android,Firebase,Xamarin,Firebase Cloud Messaging,我正在尝试使用Xamarin.Android应用程序测试FCM在不同类型的通信中的使用,并且我已经能够设置好所有内容,但是当我尝试为我的Visual Studio Emulator-Android(棉花糖)获取注册令牌时,我遇到了这个错误 java.lang.SecurityException:不允许启动服务意图{ act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (有多余的)}未经允许 com.goog
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.fqtrs.xamtest" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<!--suppress UsesMinSdkAttributes-->
<uses-sdk android:minSdkVersion="16" />
<!-- This app has permission to register with GCM and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.c2dm.permission.SEND" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to wakeup the device and deliver messages -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="net.fqtrs.xamtest.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="net.fqtrs.xamtest.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:label="FCMNotifications" android:name="android.app.Application" android:allowBackup="true" android:icon="@drawable/icon" android:debuggable="true">
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<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="net.fqtrs.xamtest" />
</intent-filter>
</receiver>
<activity android:icon="@drawable/icon" android:label="FCMNotifications" android:name="md50b8cb7a267d8690e7668352ad20476c5.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="md50b8cb7a267d8690e7668352ad20476c5.MyFirebaseIIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="md50b8cb7a267d8690e7668352ad20476c5.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="net.fqtrs.xamtest.mono.MonoRuntimeProvider.__mono_init__" />
<!--suppress ExportedReceiver-->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.net.fqtrs.xamtest" />
</intent-filter>
</receiver>
<provider android:authorities="net.fqtrs.xamtest.firebaseinitprovider" android:name="com.google.firebase.provider.FirebaseInitProvider" android:exported="false" android:initOrder="100" />
<!-- FirebaseMessagingService performs security checks at runtime,
no need for explicit permissions despite exported="true" -->
<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>
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
我想不出它有什么毛病。有人有什么想法吗?您的
obj/Debug/Android
中的finalAndroidManifest.xml
包含什么?您的obj/Debug/Android
中的finalAndroidManifest.xml
包含什么?