GCM无法在Android虚拟设备上运行:java.lang.UnsupportedOperationException:设备没有包com.google.android.gsf

时间:2014-09-20 15:18:40

标签: android google-cloud-messaging

在调用

时抛出异常
    try {
        GCMIntentService.register(this.getContext());
        //isRegistationPending = true;
    } catch (Exception e) {
        //probleme during GCM registration
        SnooziUtility.trace(TRACETYPE.ERROR, "GCM Registration error :  " +  e.toString());
    }

java.lang.UnsupportedOperationException:设备没有包com.google.android.gsf

是因为虚拟设备不支持GCM吗?

1 个答案:

答案 0 :(得分:2)

com.google.android.gsf包添加到您的项目中,并在您需要的任何地方使用它。