I am developing Xamarin Cross platform application in which I am using Google Cloud Messaging service. So when I call below method, I get exception "Device does not have package com.google.android.gsf". I trying to run this project on Visual Studio Android Emulator (MarshMallow Android 6.0 -API 23) and (Lollipop Android 5.1 - API 22)
So how to overcome this problem. Thanks in advance.
try {
GcmClient.CheckDevice(this);
GcmClient.CheckManifest(this);
// Register for push notifications
Log.Info("MainActivity", "Registering...");
GcmClient.Register(this, Constants.SenderID);
}
catch(Exception ex)
{
}
Visual Studio Emulators do not have it installed by default. Hence you need to install the Gapps CyanogenMod, which contains the Google Apps needed to run things such as Push Notifications.
Download Gapps CyanogenMod for your emulator version. (For the visual studio emulators you want to pick the HDPI / MDPI / TINY version).
Once downloaded make sure you have your emulator loaded. Drag and drop the zip file into the emulator. You will be prompted to install.
Now you will no longer get the Device does not have package com.google.android.gsf
error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With