ADuggan
ADuggan

Reputation: 501

Xamarin Android app crashes when using GCM

Im following the tutorial to add Google Cloud Messaging to your xamarin android project (Walkthrough - Using Remote Notifications in Xamarin.Android).

But im having trouble trying to connect to Google Services. Everytime i try to build/ run my app, Visual Studio just trys to launch the app but then stops about a second later.

Heres the output message:

Android application is debugging. The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).

Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.

Here is my manifest file also:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
          package="PushNotificationsAndroid.PushNotificationsAndroid" 
          android:versionCode="1" 
          android:versionName="1.0" 
          android:installLocation="auto">
    <uses-sdk android:minSdkVersion="16" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.INTERNET" />
    <user-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
  <permission android:name="PushNotificationsAndroid.PushNotificationsAndroid.permission.C2D_MESSAGE"
              android:protectionLevel="signature" />
  <uses-permission android:name="PushNotificationsAndroid.PushNotificationsAndroid.permission.C2D_MESSAGE" />
    <application android:label="PushNotificationsAndroid"></application>
</manifest>

I commented out some of the permission lines and this issue seems just to happen when i added the line:

<permission android:name="PushNotificationsAndroid.PushNotificationsAndroid.permission.C2D_MESSAGE"
              android:protectionLevel="signature" />

Can anyone give me some advice to why this is happening?

Upvotes: 0

Views: 222

Answers (1)

ADuggan
ADuggan

Reputation: 501

Found a solution. I just had to make the package name lowercase for some reason

com.notifications.pushnotificationsandroid

Upvotes: 3

Related Questions