【问题标题】:Push notifications in Android emulator (5.1.1 or later)在 Android 模拟器中推送通知(5.1.1 或更高版本)
【发布时间】:2016-06-17 17:50:09
【问题描述】:

我已经在 Google 注册了 GCM 帐户并设置了我的应用程序以接受推送通知,但在模拟器中我没有收到它们(我也尝试过使用第 3 方测试应用程序 (https://imamraza.wordpress.com/2013/09/04/how-to-test-android-gcm-push-notification/)万一我做错了什么并且这也不起作用 - 不幸的是,我无法使用真实设备进行测试)。

在阅读了其他一些 StackOverflow 答案(Android emulator not receiving push notificationsPush notifications don't work)之后,我似乎需要创建一个带有Google APIs 目标的模拟器。起初它不存在,但在 Android SDK Manager 中添加更多包后,我能够看到 Google APIs 作为目标。不幸的是,将目标设置为导致 CPU/ABI“没有为此目标安装系统映像”错误:

经过一番挖掘,我偶然发现了更多 SO 答案,建议安装额外的软件包 (Fail to create Android virtual Device, "No system image installed for this Target")。这也没有帮助,这是我现在安装的:

其他人推荐的列表中唯一缺少的是“Android 支持”库,根据android list sdk -a --extended,它现在似乎已被弃用:

----------
id: 140 or "extra-android-support"
    Type: Extra
    Desc: Android Support Library, revision 23.2.1 (Obsolete)
        By Android
        Install path: extras/android/support

要让带有 Google API 目标的 Android 模拟器正常工作,我缺少什么?我偶然发现的很多建议似乎都过时了。

【问题讨论】:

    标签: push-notification android-emulator google-cloud-messaging


    【解决方案1】:

    试试这个:

    目标:Android 6.0 - API 级别 23(或其他没有“Google API”的目标)

    CPU/ABI:Google API Intel Atom (x86)

    【讨论】:

      猜你喜欢
      • 2015-10-30
      • 1970-01-01
      • 1970-01-01
      • 2013-12-29
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多