【发布时间】:2016-03-31 10:52:05
【问题描述】:
我在一个应用程序中使用 google GCM,它工作正常,但问题是它添加了额外的进程(参见 Screenpic Shows 2 process),名为 Google Play 服务 (com.google.android.gms) 消耗大约 20MB,应用使用量加起来为 28MB
问题 Screenshot of the App Settings View
注意:我没有在 AndroidManifest.xml
中的任何地方使用 android:process即使关闭应用后仍然显示 1 个服务和 2 个进程
附加过程从何而来?在多个设备中测试 (奇巧,棒棒糖)
<receiver android:name=".gcm.services.simple.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:exported="true">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<category android:name="com.tempapp" />
</intent-filter>
</receiver>
<service android:name=".gcm.services.simple.GcmIntentService" />
<service android:name=".gcm.services.listeners.InstanceIDListener" android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
Gradle:
模块级别
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
项目级别
classpath 'com.android.tools.build:gradle:2.1.0-alpha4'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
【问题讨论】:
-
@CommonsWare 你能帮忙解决这个问题吗?
标签: android google-cloud-messaging gcmlistenerservice