Par*_*iya 6 android-emulator google-cloud-messaging xamarin.forms visual-studio-2015
我正在开发Xamarin Cross平台应用程序,我正在使用Google Cloud Messaging服务.因此,当我调用下面的方法时,我得到异常"设备没有包com.google.android.gsf".我试图在Visual Studio Android Emulator(MarshMallow Android 6.0 -API 23)和(Lollipop Android 5.1 - API 22)上运行这个项目
那么如何克服这个问题呢.提前致谢.
try {
GcmClient.CheckDevice(this);
GcmClient.CheckManifest(this);
// Register for push notifications
Log.Info("MainActivity", "Registering...");
GcmClient.Register(this, Constants.SenderID);
}
catch(Exception ex)
{
}
Run Code Online (Sandbox Code Playgroud)
默认情况下,Visual Studio仿真器没有安装它.因此,您需要安装Gapps CyanogenMod,其中包含运行推送通知等所需的Google Apps.
下载Gapps CyanogenMod为您的模拟器版本.(对于想要选择HDPI/MDPI/TINY版本的visual studio模拟器).
下载后请确保已加载模拟器.将zip文件拖放到模拟器中.系统将提示您安装.
现在您将不再收到Device does not have package com.google.android.gsf错误.
| 归档时间: |
|
| 查看次数: |
2389 次 |
| 最近记录: |